Add help strings to command line options

This commit is contained in:
Disassembler 2020-05-24 08:55:02 +02:00
parent 021bac46b3
commit 7b3c2088e1
No known key found for this signature in database
GPG Key ID: 524BD33A0EE29499
3 changed files with 28 additions and 28 deletions

View File

@ -123,45 +123,45 @@ subparsers = parser.add_subparsers()
parser_list = subparsers.add_parser('list') parser_list = subparsers.add_parser('list')
parser_list.set_defaults(action=listing) parser_list.set_defaults(action=listing)
parser_list.add_argument('type', choices=('installed', 'online', 'updates', 'published', 'running', 'stopped'), default='installed', const='installed', nargs='?') parser_list.add_argument('type', choices=('installed', 'online', 'updates', 'published', 'running', 'stopped'), default='installed', const='installed', nargs='?', help='Selected repository or application criteria')
parser_install = subparsers.add_parser('install') parser_install = subparsers.add_parser('install')
parser_install.set_defaults(action=install) parser_install.set_defaults(action=install)
parser_install.add_argument('app') parser_install.add_argument('app', help='Name of the application to install')
parser_update = subparsers.add_parser('update') parser_update = subparsers.add_parser('update')
parser_update.set_defaults(action=update) parser_update.set_defaults(action=update)
parser_update.add_argument('app') parser_update.add_argument('app', help='Name of the application to update')
parser_uninstall = subparsers.add_parser('uninstall') parser_uninstall = subparsers.add_parser('uninstall')
parser_uninstall.set_defaults(action=uninstall) parser_uninstall.set_defaults(action=uninstall)
parser_uninstall.add_argument('app') parser_uninstall.add_argument('app', help='Name of the application to uninstall')
parser_start = subparsers.add_parser('start') parser_start = subparsers.add_parser('start')
parser_start.set_defaults(action=start) parser_start.set_defaults(action=start)
parser_start.add_argument('app') parser_start.add_argument('app', help='Name of the application to start')
parser_stop = subparsers.add_parser('stop') parser_stop = subparsers.add_parser('stop')
parser_stop.set_defaults(action=stop) parser_stop.set_defaults(action=stop)
parser_stop.add_argument('app') parser_stop.add_argument('app', help='Name of the application to stop')
parser_status = subparsers.add_parser('status') parser_status = subparsers.add_parser('status')
parser_status.set_defaults(action=status) parser_status.set_defaults(action=status)
parser_status.add_argument('app') parser_status.add_argument('app', help='Name of the application to check')
parser_publish = subparsers.add_parser('publish') parser_publish = subparsers.add_parser('publish')
parser_publish.set_defaults(action=publish) parser_publish.set_defaults(action=publish)
parser_publish.add_argument('-f', '--force', action='store_true', help='Force republish already published application') parser_publish.add_argument('-f', '--force', action='store_true', help='Force republish already published application')
parser_publish.add_argument('filename') parser_publish.add_argument('filename', help='Path to metadata file of the application to publish')
parser_unpublish = subparsers.add_parser('unpublish') parser_unpublish = subparsers.add_parser('unpublish')
parser_unpublish.set_defaults(action=unpublish) parser_unpublish.set_defaults(action=unpublish)
parser_unpublish.add_argument('app') parser_unpublish.add_argument('app', help='Name of the application to unpublish')
parser_autostart = subparsers.add_parser('autostart') parser_autostart = subparsers.add_parser('autostart')
parser_autostart.set_defaults(action=autostart) parser_autostart.set_defaults(action=autostart)
parser_autostart.add_argument('app') parser_autostart.add_argument('app', help='Name of the application to be automatically started')
parser_autostart.add_argument('value', choices=('1', 'on', 'enable', 'true', '0', 'off', 'disable', 'false'), help='Sets the applications to be automatically started after the host boots up') parser_autostart.add_argument('value', choices=('1', 'on', 'enable', 'true', '0', 'off', 'disable', 'false'), help='Set or unset the applications to be automatically started after the host boots up')
parser_start_autostarted = subparsers.add_parser('start-autostarted') parser_start_autostarted = subparsers.add_parser('start-autostarted')
parser_start_autostarted.set_defaults(action=start_autostarted) parser_start_autostarted.set_defaults(action=start_autostarted)

View File

@ -114,7 +114,7 @@ subparsers = parser.add_subparsers()
parser_list = subparsers.add_parser('list') parser_list = subparsers.add_parser('list')
parser_list.set_defaults(action=listing) parser_list.set_defaults(action=listing)
parser_list.add_argument('type', choices=('all', 'running', 'stopped'), default='all', const='all', nargs='?') parser_list.add_argument('type', choices=('all', 'running', 'stopped'), default='all', const='all', nargs='?', help='Selected container criteria')
parser_create = subparsers.add_parser('create') parser_create = subparsers.add_parser('create')
parser_create.set_defaults(action=create) parser_create.set_defaults(action=create)
@ -127,8 +127,8 @@ parser_create.add_argument('-c', '--cmd', help='Sets the container init command'
parser_create.add_argument('-w', '--workdir', help='Sets the container init working directory') parser_create.add_argument('-w', '--workdir', help='Sets the container init working directory')
parser_create.add_argument('-r', '--ready', help='Sets the container ready command') parser_create.add_argument('-r', '--ready', help='Sets the container ready command')
parser_create.add_argument('-s', '--stopsig', help='Sets the signal to be sent to init on container shutdown') parser_create.add_argument('-s', '--stopsig', help='Sets the signal to be sent to init on container shutdown')
parser_create.add_argument('container') parser_create.add_argument('container', help='Name of the container to create')
parser_create.add_argument('image') parser_create.add_argument('image', help='Name of the image of which the container should be based')
parser_modify = subparsers.add_parser('modify') parser_modify = subparsers.add_parser('modify')
parser_modify.set_defaults(action=modify) parser_modify.set_defaults(action=modify)
@ -141,31 +141,31 @@ parser_modify.add_argument('-c', '--cmd', help='Sets the container init command'
parser_modify.add_argument('-w', '--workdir', help='Sets the container init working directory') parser_modify.add_argument('-w', '--workdir', help='Sets the container init working directory')
parser_modify.add_argument('-r', '--ready', help='Sets the container ready command') parser_modify.add_argument('-r', '--ready', help='Sets the container ready command')
parser_modify.add_argument('-s', '--stopsig', help='Sets the signal to be sent to init on container shutdown') parser_modify.add_argument('-s', '--stopsig', help='Sets the signal to be sent to init on container shutdown')
parser_modify.add_argument('container') parser_modify.add_argument('container', help='Name of the container to modify')
parser_destroy = subparsers.add_parser('destroy') parser_destroy = subparsers.add_parser('destroy')
parser_destroy.set_defaults(action=destroy) parser_destroy.set_defaults(action=destroy)
parser_destroy.add_argument('container') parser_destroy.add_argument('container', help='Name of the container to destroy')
parser_start = subparsers.add_parser('start') parser_start = subparsers.add_parser('start')
parser_start.set_defaults(action=start) parser_start.set_defaults(action=start)
parser_start.add_argument('container') parser_start.add_argument('container', help='Name of the container to start')
parser_start.add_argument('command', nargs=argparse.REMAINDER) parser_start.add_argument('command', nargs=argparse.REMAINDER, help='Command to be run instead of the default init command')
parser_stop = subparsers.add_parser('stop') parser_stop = subparsers.add_parser('stop')
parser_stop.set_defaults(action=stop) parser_stop.set_defaults(action=stop)
parser_stop.add_argument('container') parser_stop.add_argument('container', help='Name of the container to stop')
parser_status = subparsers.add_parser('status') parser_status = subparsers.add_parser('status')
parser_status.set_defaults(action=status) parser_status.set_defaults(action=status)
parser_status.add_argument('container') parser_status.add_argument('container', help='Name of the container to check')
parser_exec = subparsers.add_parser('exec') parser_exec = subparsers.add_parser('exec')
parser_exec.set_defaults(action=execute) parser_exec.set_defaults(action=execute)
parser_exec.add_argument('-u', '--uid', help='Sets the command UID') parser_exec.add_argument('-u', '--uid', help='Sets the command UID')
parser_exec.add_argument('-g', '--gid', help='Sets the command GID') parser_exec.add_argument('-g', '--gid', help='Sets the command GID')
parser_exec.add_argument('container') parser_exec.add_argument('container', help='Name of the container in which to run the command')
parser_exec.add_argument('command', nargs=argparse.REMAINDER) parser_exec.add_argument('command', nargs=argparse.REMAINDER, help='The command to be run')
args = parser.parse_args() args = parser.parse_args()

View File

@ -113,15 +113,15 @@ subparsers = parser.add_subparsers()
parser_list = subparsers.add_parser('list') parser_list = subparsers.add_parser('list')
parser_list.set_defaults(action=listing) parser_list.set_defaults(action=listing)
parser_list.add_argument('type', choices=('installed', 'online', 'published'), default='installed', const='installed', nargs='?') parser_list.add_argument('type', choices=('installed', 'online', 'published'), default='installed', const='installed', nargs='?', help='Selected repository')
parser_download = subparsers.add_parser('download') parser_download = subparsers.add_parser('download')
parser_download.set_defaults(action=download) parser_download.set_defaults(action=download)
parser_download.add_argument('image') parser_download.add_argument('image', help='Name of the image to download')
parser_delete = subparsers.add_parser('delete') parser_delete = subparsers.add_parser('delete')
parser_delete.set_defaults(action=delete) parser_delete.set_defaults(action=delete)
parser_delete.add_argument('image') parser_delete.add_argument('image', help='Name of the image to delete')
parser_clean = subparsers.add_parser('clean') parser_clean = subparsers.add_parser('clean')
parser_clean.set_defaults(action=clean) parser_clean.set_defaults(action=clean)
@ -130,16 +130,16 @@ parser_build = subparsers.add_parser('build')
parser_build.set_defaults(action=build) parser_build.set_defaults(action=build)
parser_build.add_argument('-f', '--force', action='store_true', help='Force rebuild already existing image') parser_build.add_argument('-f', '--force', action='store_true', help='Force rebuild already existing image')
parser_build.add_argument('-p', '--publish', action='store_true', help='Publish the image after successful build') parser_build.add_argument('-p', '--publish', action='store_true', help='Publish the image after successful build')
parser_build.add_argument('filename') parser_build.add_argument('filename', help='Path to the file with build recipe')
parser_publish = subparsers.add_parser('publish') parser_publish = subparsers.add_parser('publish')
parser_publish.set_defaults(action=publish) parser_publish.set_defaults(action=publish)
parser_publish.add_argument('-f', '--force', action='store_true', help='Force republish already published image') parser_publish.add_argument('-f', '--force', action='store_true', help='Force republish already published image')
parser_publish.add_argument('image') parser_publish.add_argument('image', help='Name of the image to publish')
parser_unpublish = subparsers.add_parser('unpublish') parser_unpublish = subparsers.add_parser('unpublish')
parser_unpublish.set_defaults(action=unpublish) parser_unpublish.set_defaults(action=unpublish)
parser_unpublish.add_argument('image') parser_unpublish.add_argument('image', help='Name of the image to unpublish')
args = parser.parse_args() args = parser.parse_args()