updated help strings of commands
This commit is contained in:
+23
-4
@@ -2,6 +2,25 @@
|
||||
|
||||
import sys
|
||||
|
||||
usage = """Usage:
|
||||
etherdump CMD
|
||||
|
||||
where CMD could be:
|
||||
sync
|
||||
gettext
|
||||
gethtml
|
||||
creatediffhtml
|
||||
dumpcsv
|
||||
list
|
||||
listauthors
|
||||
revisionscount
|
||||
showmeta
|
||||
|
||||
For more information on each command try:
|
||||
etherdump CMD --help
|
||||
|
||||
"""
|
||||
|
||||
try:
|
||||
cmd = sys.argv[1]
|
||||
if cmd.startswith("-"):
|
||||
@@ -10,13 +29,13 @@ try:
|
||||
else:
|
||||
args = sys.argv[2:]
|
||||
except IndexError:
|
||||
cmd = "sync"
|
||||
args = sys.argv[1:]
|
||||
|
||||
print usage
|
||||
sys.exit(0)
|
||||
try:
|
||||
# http://stackoverflow.com/questions/301134/dynamic-module-import-in-python
|
||||
cmdmod = __import__("etherdump.commands.%s" % cmd, fromlist=["etherdump.commands"])
|
||||
cmdmod.main(args)
|
||||
except ImportError, e:
|
||||
print "Command '{0}' not available ({1})".format(cmd, e)
|
||||
print "Error performing command '{0}'\n(python said: {1})\n".format(cmd, e)
|
||||
print usage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user