Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[cli][xs]: use entry_point name for command name rather than name on …

…command.

* This allows (for unusual case) where same underlying command is aliased to
  two different names in setup.py or where a command has different name in
  entry_point from on object.
  • Loading branch information...
commit 71382ea1c89dcd98c105f8eaa302ec422cf29b69 1 parent 40e92d9
@rgrp rgrp authored
Showing with 4 additions and 4 deletions.
  1. +4 −4 dpm/cli/__init__.py
View
8 dpm/cli/__init__.py
@@ -37,17 +37,17 @@ def run(self, options, args):
return
print self.general_usage
print 'Commands available:'
- commands = list(set(_commands.values()))
- commands.sort(key=lambda x: x.name)
+ commands = list(set(_commands.keys()))
+ commands.sort()
for command in commands:
- print ' %s: %s' % (command.name, command.summary)
+ print ' %s: %s' % (command, _commands[command].summary)
import pkg_resources
for entry_point in pkg_resources.iter_entry_points('dpm.cli'):
cmd = entry_point.load()
cmdinstance = cmd()
- _commands[cmdinstance.name] = cmdinstance
+ _commands[entry_point.name] = cmdinstance
def main(initial_args=None):
Please sign in to comment.
Something went wrong with that request. Please try again.