Edit cli parsers
This commit is contained in:
parent
3d4cacf72b
commit
a75a12eb80
33
jlmkr.py
33
jlmkr.py
|
@ -870,29 +870,30 @@ def main():
|
||||||
subparsers = parser.add_subparsers(
|
subparsers = parser.add_subparsers(
|
||||||
title='commands', dest='subcommand', metavar="")
|
title='commands', dest='subcommand', metavar="")
|
||||||
|
|
||||||
create_parser = subparsers.add_parser(
|
subparsers.add_parser(name='install', epilog=DISCLAIMER,
|
||||||
name='create', epilog=DISCLAIMER, help='create a new jail')
|
help='install jailmaker dependencies and create symlink')
|
||||||
create_parser.add_argument('name', nargs='?', help='name of the jail')
|
|
||||||
|
|
||||||
start_parser = subparsers.add_parser(
|
subparsers.add_parser(name='create', epilog=DISCLAIMER,
|
||||||
name='start', epilog=DISCLAIMER, help='start a previously created jail')
|
help='create a new jail').add_argument(
|
||||||
start_parser.add_argument('name', help='name of the jail')
|
'name', nargs='?', help='name of the jail')
|
||||||
|
|
||||||
subparsers.add_parser(name='edit', epilog=DISCLAIMER).add_argument(
|
subparsers.add_parser(name='start', epilog=DISCLAIMER,
|
||||||
|
help='start a previously created jail').add_argument(
|
||||||
|
'name', help='name of the jail')
|
||||||
|
|
||||||
|
subparsers.add_parser(name='edit', epilog=DISCLAIMER,
|
||||||
|
help='edit jail config with nano text editor').add_argument(
|
||||||
'name', help='name of the jail to edit')
|
'name', help='name of the jail to edit')
|
||||||
|
|
||||||
subparsers.add_parser(name='remove', epilog=DISCLAIMER).add_argument(
|
subparsers.add_parser(name='remove', epilog=DISCLAIMER,
|
||||||
|
help='remove a previously created jail').add_argument(
|
||||||
'name', help='name of the jail to remove')
|
'name', help='name of the jail to remove')
|
||||||
|
|
||||||
subparsers.add_parser(name='list', epilog=DISCLAIMER)
|
subparsers.add_parser(name='list', epilog=DISCLAIMER,
|
||||||
|
help='list jails (created and running)')
|
||||||
|
|
||||||
subparsers.add_parser(name='install', epilog=DISCLAIMER,
|
subparsers.add_parser(name='images', epilog=DISCLAIMER,
|
||||||
help="Install jailmaker dependencies and create symlink")
|
help='list available images to create jails from')
|
||||||
|
|
||||||
images_parser = subparsers.add_parser(
|
|
||||||
name='images', epilog=DISCLAIMER, help='show the list of images available to create jails from')
|
|
||||||
|
|
||||||
# parser.usage = f"{parser.format_usage()[7:]}{create_parser.format_usage()}{start_parser.format_usage()}{images_parser.format_usage()}"
|
|
||||||
|
|
||||||
if os.getuid() != 0:
|
if os.getuid() != 0:
|
||||||
parser.print_usage()
|
parser.print_usage()
|
||||||
|
|
Loading…
Reference in New Issue