Skip to content

Commit

Permalink
Replace '_' with '-' in command line option flags
Browse files Browse the repository at this point in the history
Generate more beutiful command lines by not requiring the user to enter
the under natural '_' for command line options where '-' would usually
be expted. For example "--my_opt" is not generated as "--my-opt". Closes
issue #37.
  • Loading branch information
Aaron Iles committed Feb 17, 2014
1 parent 566301c commit 389fc48
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -7,6 +7,7 @@ Next release 0.8
* Create positional command line arguments for require parameters
* Published Python wheel packages to PyPI to improve install times
* Custom help formatters for control command line help output
* Replace '_' with '-' in command line option flags
* Deprecate context.return_value for context.last_return and
context.return_values

Expand Down
2 changes: 1 addition & 1 deletion begin/cmdline.py
Expand Up @@ -115,7 +115,7 @@ def populate_parser(parser, defaults, funcsig, short_args, lexical_order):
if kwargs['default'] is NODEFAULT:
args.append(param.name)
else:
args.append('--' + param.name)
args.append('--' + param.name.replace('_', '-'))
if short_args:
args.append('-' + param.name[0])
if 'help' not in kwargs:
Expand Down

0 comments on commit 389fc48

Please sign in to comment.