Skip to content

Commit

Permalink
Fixed parser
Browse files Browse the repository at this point in the history
  • Loading branch information
maouw committed Sep 20, 2023
1 parent 3dd267b commit 16470f7
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions hyakvnc/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,10 @@ def create_arg_parser():
# kill command
parser_stop = subparsers.add_parser('stop', help='Stop specified job')

stop_group = parser_stop.add_mutually_exclusive_group(required=True)
stop_group.add_argument('job_id', metavar='<job_id>',
parser_stop.add_argument('job_id', metavar='<job_id>',
help='Kill specified VNC session, cancel its VNC job, and exit', type=int)

stop_group.add_argument('-a', '--all', action='store_true', dest='stop_all', help='Stop all VNC sessions and exit')

parser_stop_all = subparsers.add_parser('stop_all', help='Stop all VNC sessions and exit')
return parser


Expand Down Expand Up @@ -247,6 +245,9 @@ def create_arg_parser():
cmd_status()

if args.command == 'stop':
cmd_stop(args.job_id, args.stop_all)
cmd_stop(args.job_id)

if args.command == 'stop_all':
cmd_stop(stop_all=True)

exit(0)

0 comments on commit 16470f7

Please sign in to comment.