Skip to content

Commit 2f3724e

Browse files
committed
cli: Improve docs for new login --api-key option
* Make the help text more explicit * Add it to the man page Signed-off-by: Cole Robinson <[email protected]>
1 parent 86dea08 commit 2f3724e

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

bugzilla.1

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,9 @@ Then create a ~/.config/python-bugzilla/bugzillarc like this:
247247
Replace 'bugzilla.example.com' with your bugzilla host name,
248248
and YOUR_API_KEY with the generated API Key from the Web UI.
249249

250+
Alternatively, you can use 'bugzilla login --api-key', which
251+
will ask for the API key, and save it to bugzillarc for you.
252+
250253
For older bugzilla instances, you will need to cache a login
251254
cookie or token with the "login" subcommand or the "--login"
252255
argument.

bugzilla/_cli.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -432,15 +432,16 @@ def _setup_action_login_parser(subparsers):
432432
usage = 'bugzilla login [--api-key] [username [password]]'
433433
description = """Log into bugzilla and save a login cookie or token.
434434
Note: These tokens are short-lived, and future Bugzilla versions will no
435-
longer support token authentication at all. Please use an API key instead."""
435+
longer support token authentication at all. Please use a
436+
~/.config/python-bugzilla/bugzillarc file with an API key instead, or
437+
use 'bugzilla login --api-key' and we will save it for you."""
436438
p = subparsers.add_parser("login", description=description, usage=usage)
437439
p.add_argument('--api-key', action='store_true', default=False,
438-
help='Use an API-KEY instead of username/password.')
439-
p.add_argument("pos_username", nargs="?", help="Optional username " \
440-
"(ignored if --api-key is provided)",
440+
help='Prompt for and save an API key into bugzillarc, '
441+
'rather than prompt for username and password.')
442+
p.add_argument("pos_username", nargs="?", help="Optional username ",
441443
metavar="username")
442-
p.add_argument("pos_password", nargs="?", help="Optional password " \
443-
"(ignored if --api-key is provided)",
444+
p.add_argument("pos_password", nargs="?", help="Optional password ",
444445
metavar="password")
445446

446447

0 commit comments

Comments
 (0)