16
16
@click .group ()
17
17
@click .option ('--debug' , default = False , is_flag = True ,
18
18
help = "Output more information about what's going on." )
19
+ @click .option ('--token' , metavar = 'TOKEN' , envvar = 'PW_TOKEN' ,
20
+ help = 'Authentication token.' )
19
21
@click .option ('--username' , metavar = 'USERNAME' , envvar = 'PW_USERNAME' ,
20
22
help = 'Authentication username.' )
21
23
@click .option ('--password' , metavar = 'PASSWORD' , envvar = 'PW_PASSWORD' ,
25
27
@click .option ('--project' , metavar = 'PROJECT' , envvar = 'PW_PROJECT' ,
26
28
help = 'Patchwork project.' )
27
29
@click .version_option ()
28
- def cli (debug , username , password , server , project ):
30
+ def cli (debug , token , username , password , server , project ):
29
31
"""git-pw is a tool for integrating Git with Patchwork.
30
32
31
33
git-pw can interact with individual patches, complete patch series, and
@@ -34,19 +36,14 @@ def cli(debug, username, password, server, project):
34
36
35
37
The git-pw utility is a wrapper which makes REST calls to the Patchwork
36
38
service. To use git-pw, you must set up your environment by configuring
37
- your Patchwork server URL, username, and password.
38
-
39
- Configuring the patchwork URL::
39
+ your Patchwork server URL and either an API token or a username and
40
+ password. To configure the server URL, run::
40
41
41
42
git config pw.server http://pw.server.com/path/to/patchwork
42
43
43
- Configuring username::
44
-
45
- git config pw.username userid
46
-
47
- Configuring password::
44
+ To configure the token, run::
48
45
49
- git config pw.password pass
46
+ git config pw.token token
50
47
51
48
Alternatively, you can pass these options via command line parameters or
52
49
environment variables.
@@ -57,6 +54,7 @@ def cli(debug, username, password, server, project):
57
54
logger .configure_verbosity (debug )
58
55
59
56
CONF .debug = debug
57
+ CONF .token = token
60
58
CONF .username = username
61
59
CONF .password = password
62
60
CONF .server = server
0 commit comments