Repository navigation
uuidgen: accept a UUID as --namespace - #674
jayhemnani9910 wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
| new_ucmd!() | ||
| .args(&["-s", "-n", namespace, "-N", "a"]) | ||
| .fails() | ||
| .code_is(1); |
There was a problem hiding this comment.
could you please also check the error message here? the exit code alone could come from something else :)
There was a problem hiding this comment.
Done in bcd5dfc: each rejected namespace now also checks for Invalid namespace <value>. on stderr.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
uuidgen --namespaceonly takes the four@dns,@url,@oidand@x500names. util-linux also takes any UUID there, which is how name-based UUIDs under an application's own namespace are made:namespace_from_strnow falls back to parsing a UUID. Like libuuid'suuid_parse(), only the 36-character hyphenated form is accepted, in either case; braced,urn:uuid:and 32-digit forms are still rejected, as util-linux rejects them. The help text mentions it.New test
test_uuid_namespace(fails without the change) checks a lower and an upper case UUID against util-linux's output and the four rejected forms. The uuidgen tests pass (9),cargo clippy --all-targets -D warningsis clean for the crate. The two UUIDs also match Python'suuid.uuid3/uuid.uuid5.