Commit ca7f1eac authored by Jason Chase's avatar Jason Chase Committed by Commit Bot

Improve usability for generate_token.py

Make |version| a named parameter instead of positional. This should
make command lines less error-prone and magical (i.e. "what's this 3 in
the middle of the command").

Change-Id: I7ac59fa0268c0015f99232a8d3e24a64dadee717
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2204627Reviewed-by: default avatarIan Clelland <iclelland@chromium.org>
Commit-Queue: Jason Chase <chasej@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771081}
parent 83c14c4e
...@@ -10,7 +10,8 @@ usage: generate_token.py [-h] [--key-file KEY_FILE] ...@@ -10,7 +10,8 @@ usage: generate_token.py [-h] [--key-file KEY_FILE]
--expire-timestamp EXPIRE_TIMESTAMP] --expire-timestamp EXPIRE_TIMESTAMP]
[--is_subdomain | --no-subdomain] [--is_subdomain | --no-subdomain]
[--is_third-party | --no-third-party] [--is_third-party | --no-third-party]
version origin trial_name --version=VERSION
origin trial_name
Run "generate_token.py -h" for more help on usage. Run "generate_token.py -h" for more help on usage.
""" """
...@@ -131,11 +132,10 @@ def main(): ...@@ -131,11 +132,10 @@ def main():
parser = argparse.ArgumentParser( parser = argparse.ArgumentParser(
description="Generate tokens for enabling experimental features") description="Generate tokens for enabling experimental features")
parser.add_argument( parser.add_argument("--version",
"version", help="Token version to use. Currently only version 2"
help="Token version to use. Currently only version 2" "and version 3 are supported.",
"and version 3 are supported.", type=VersionFromArg)
type=VersionFromArg)
parser.add_argument("origin", parser.add_argument("origin",
help="Origin for which to enable the feature. This can " help="Origin for which to enable the feature. This can "
"be either a hostname (default scheme HTTPS, " "be either a hostname (default scheme HTTPS, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment