cmdln icon indicating copy to clipboard operation
cmdln copied to clipboard

hyphens in subcmd name [moved]

Open trentm opened this issue 12 years ago • 0 comments

This is Issue 18 moved from a Google Code project. Added by 2009-09-02T22:43:35.000Z by [email protected]. Please review that bug for more context and additional comments, but update this bug.

Original labels: Type-Enhancement, Priority-Low, Usability

Original description

I would like to have hyphens in sub commands, but the Python syntax will 
prohibit it.

  $ pypm show-files ipython

The closest possibly way to do this currently is s/-/_/

  def do_show_files(...): pass

But I like 'pypm show-files' better than 'pypm show_files' .. as an end-
user.

Perhaps a decorator would be nice?

  @cmdln.name('show-files')
  def do_show_files(...'): pass

Or:

  @cmdln.contrib.hyphenedname
  def do_show_files(...): pass

where cmdln.contrib is a package containing various unsupported 
"extensions" to cmdln (a plugin-like mechanism).

trentm avatar Sep 28 '12 04:09 trentm