Print usage if no action is specified
This commit is contained in:
parent
e05a024a79
commit
bc623fc93f
@ -29,9 +29,13 @@ def ls(session: sa.orm.Session):
|
||||
###############################################################################
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
import argparse
|
||||
|
||||
def none(parser: argparse.ArgumentParser):
|
||||
parser.print_usage()
|
||||
sys.exit(1)
|
||||
|
||||
def main():
|
||||
import argparse
|
||||
import os
|
||||
|
||||
actions = {
|
||||
@ -41,6 +45,7 @@ if __name__ == '__main__':
|
||||
}
|
||||
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.set_defaults(func=lambda x: none(parser))
|
||||
subparsers = parser.add_subparsers()
|
||||
|
||||
add_parser = subparsers.add_parser('add')
|
||||
|
Loading…
Reference in New Issue
Block a user