mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-13 22:42:29 +03:00
fdroid.py: a pointer to the -h option of commands
This commit is contained in:
parent
ec396c3cc5
commit
409fd273b6
1 changed files with 8 additions and 6 deletions
14
fdroid
14
fdroid
|
@ -31,21 +31,23 @@ commands = [
|
||||||
"stats",
|
"stats",
|
||||||
"server"]
|
"server"]
|
||||||
|
|
||||||
|
def print_help():
|
||||||
|
print "Valid commands are:"
|
||||||
|
for command in commands:
|
||||||
|
print " " + command
|
||||||
|
print "Use '%s <command> -h' for more info about that command."%sys.argv[0]
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
if len(sys.argv) <= 1:
|
if len(sys.argv) <= 1:
|
||||||
print "Specify a command. Valid commands are:"
|
print_help()
|
||||||
for command in commands:
|
|
||||||
print " " + command
|
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
command = sys.argv[1]
|
command = sys.argv[1]
|
||||||
if not command in commands:
|
if not command in commands:
|
||||||
print "Command '" + command + "' not recognised."
|
print "Command '" + command + "' not recognised."
|
||||||
print ""
|
print ""
|
||||||
print "Valid commands are:"
|
print_help()
|
||||||
for command in commands:
|
|
||||||
print " " + command
|
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
||||||
# Trick optparse into displaying the right usage when --help is used.
|
# Trick optparse into displaying the right usage when --help is used.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue