forked from moroen/IKEA-Tradfri-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli.py
25 lines (16 loc) · 729 Bytes
/
cli.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import argparse
def get_args():
parser = argparse.ArgumentParser()
subparsers = parser.add_subparsers(dest="command")
subparsers.add_parser("version")
parser.add_argument("--debug", action="store_true")
parser_list = subparsers.add_parser("list")
parser_list.add_argument("--groups", action="store_true")
parser_config_gateway = subparsers.add_parser("config")
parser_config_gateway.add_argument("IP")
parser_config_gateway.add_argument("KEY")
parser_config_api = subparsers.add_parser("api")
parser_config_api.add_argument("API", choices=["pycoap", "coapcmd"])
parser_raw = subparsers.add_parser("raw")
parser_raw.add_argument("ID")
return parser.parse_args()