Skip to content

Commit 537b1e6

Browse files
authored
chore: make cli platform argument optional (#26)
Needs to be not positional to apply the default value, otherwise this argument is not optional.
1 parent 9e4114b commit 537b1e6

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/panda_py/cli.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
1717
"""
1818
import argparse
19+
1920
from . import Desk
2021

2122

@@ -32,7 +33,7 @@ def unlock():
3233
parser.add_argument('host', type=str, help='Robot Desk IP or hostname.')
3334
parser.add_argument('user', type=str, help='Desk username.')
3435
parser.add_argument('password', type=str, help='Desk password.')
35-
parser.add_argument('platform', type=str, default='panda', help='Platform of robot.')
36+
parser.add_argument('--platform', type=str, default='panda', help='Platform of robot.')
3637
args = parser.parse_args()
3738

3839
desk = Desk(args.host, args.user, args.password, platform=args.platform)
@@ -53,7 +54,7 @@ def lock():
5354
parser.add_argument('host', type=str, help='Robot Desk IP or hostname.')
5455
parser.add_argument('user', type=str, help='Desk username.')
5556
parser.add_argument('password', type=str, help='Desk password.')
56-
parser.add_argument('platform', type=str, default='panda', help='Platform of robot.')
57+
parser.add_argument('--platform', type=str, default='panda', help='Platform of robot.')
5758
args = parser.parse_args()
5859

5960
desk = Desk(args.host, args.user, args.password, platform=args.platform)
@@ -77,7 +78,7 @@ def reboot():
7778
parser.add_argument('host', type=str, help='Robot Desk IP or hostname.')
7879
parser.add_argument('user', type=str, help='Desk username.')
7980
parser.add_argument('password', type=str, help='Desk password.')
80-
parser.add_argument('platform', type=str, default='panda', help='Platform of robot.')
81+
parser.add_argument('--platform', type=str, default='panda', help='Platform of robot.')
8182
args = parser.parse_args()
8283

8384
desk = Desk(args.host, args.user, args.password, platform=args.platform)

0 commit comments

Comments
 (0)