Add command-line functionality to uuid module
| BPO | 44431 |
|---|---|
| Nosy | @serhiy-storchaka, @erlend-aasland, @ephenix |
| PRs |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2021-06-16.04:14:46.410>
labels = ['type-feature', '3.11']
title = 'Add command-line functionality to uuid module'
updated_at = <Date 2021-06-16.22:06:09.458>
user = 'https://github.com/ephenix'
bugs.python.org fields:
activity = <Date 2021-06-16.22:06:09.458>
actor = 'erlendaasland'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = []
creation = <Date 2021-06-16.04:14:46.410>
creator = 'ephenix'
dependencies = []
files = []
hgrepos = []
issue_num = 44431
keywords = ['patch']
message_count = 2.0
messages = ['395906', '395967']
nosy_count = 3.0
nosy_names = ['serhiy.storchaka', 'erlendaasland', 'ephenix']
pr_nums = ['26751']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue44431'
versions = ['Python 3.11']
Suggested functionality:
python -m uuid b9aa5a06-e2cd-4c26-b26b-1590f01ea996
I think it would be a useful feature.
But would not be better to make interface similar to interface of standard Linux command uuidgen? In any case it should support the -h or --help options.
@ephenix would you still like to work on this as I see you've closed your PR? If not, I'd like to work on this; I'll wait a couple of days to give you a chance to respond if you'd still like to continue.
@ephenix would you still like to work on this as I see you've closed your PR? If not, I'd like to work on this; I'll wait a couple of days to give you a chance to respond if you'd still like to continue.
I lost track of this -- feel free to take my pull request and do anything necessary to get it merged. IIRC the changes I made were working.
thanks for the contribution.
Thank you for your contribution @achhina. But I have few nitpicks:
- Most CLI tools on Unix and Linux use minus followed by a single letter as short options, and double minus followed by a sequence of letters as long option. An alternative style used in minority of commands (e.g.
findandjava) use single minus for long options. But your proposition mixes the styles: there are short options like-u, long options like--name, and also long option with a single minus-ns.argparseof course supports both styles, but I was surprised that it supports a mix, and I am not sure that it will not be broken in future (-nscan be interpreted as two separate options-nand-s). - Standard Linux utility
uuidgenhas similar interface, but conflicting short options.-nis a short alias of--namespace, and-Nis a short alias of--name. As you see option-nhas different semantic. -
uuidgenaccepts namespace argument in form:@dns @url @oid @x500. In your proposition it should be in form:NAMESPACE_DNS NAMESPACE_URL NAMESPACE_OID NAMESPACE_X500. And it is not documented.
I propose to rename -n to -N and -ns to -n, and accept simpler compatible namespace syntax.
@serhiy-storchaka that makes sense, I can create a follow-up patch in regards to the proposed changes if everyone agrees - cc @gpshead.
Good thinking Serhiy, those changes makes sense to me.
Just @ me on the PR when you've created one @achhina.
thanks for the contribution!