-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcommon.py
More file actions
44 lines (38 loc) · 1.04 KB
/
common.py
File metadata and controls
44 lines (38 loc) · 1.04 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import click
def common(function):
"""Add common options to click commands"""
function = click.option(
"--input",
"input_json",
help="JSON input data with settings",
required=False,
type=str,
)(function)
function = click.option(
"--scope",
help="Target configuration scope (user or machine)",
type=click.Choice(["user", "machine"]),
required=False,
)(function)
function = click.option(
"--exist",
"exist",
help="Check if configuration exists",
is_flag=True,
default=None,
)(function)
function = click.option(
"--updateAutomatically",
"updateAutomatically",
help="Whether updates should be automatic",
type=bool,
required=False,
)(function)
function = click.option(
"--updateFrequency",
"updateFrequency",
help="Update frequency in days (1-180)",
type=int,
required=False,
)(function)
return function