Make pubs doc subparsers required

Before, `pubs doc` alone would just exit without printing any help
This commit is contained in:
Fabien Benureau 2016-01-07 14:09:22 +01:00
parent 82c93cf695
commit a702d86a74

View File

@ -17,6 +17,7 @@ def parser(subparsers):
doc_parser = subparsers.add_parser('doc', help='manage the document relating to a publication') doc_parser = subparsers.add_parser('doc', help='manage the document relating to a publication')
doc_subparsers = doc_parser.add_subparsers(title='document actions', help='actions to interact with the documents', doc_subparsers = doc_parser.add_subparsers(title='document actions', help='actions to interact with the documents',
dest='action') dest='action')
doc_subparsers.required = True
add_parser = doc_subparsers.add_parser('add', help='add a document to a publication') add_parser = doc_subparsers.add_parser('add', help='add a document to a publication')
add_parser.add_argument('-f', '--force', action='store_true', dest='force', default=False, add_parser.add_argument('-f', '--force', action='store_true', dest='force', default=False,