mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +00:00
python: Elide nargs for argparse flag arguments.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Alex Vandiver
parent
b4597a8ca8
commit
3c5b39da9c
@@ -63,7 +63,7 @@ def parse_cache_script_args(description: str) -> argparse.Namespace:
|
||||
|
||||
parser.add_argument(
|
||||
"--threshold", dest="threshold_days", type=int, default=14,
|
||||
nargs="?", metavar="<days>", help="Any cache which is not in "
|
||||
metavar="<days>", help="Any cache which is not in "
|
||||
"use by a deployment not older than threshold days(current "
|
||||
"installation in dev) and older than threshold days will be "
|
||||
"deleted. (defaults to 14)")
|
||||
|
||||
@@ -17,7 +17,7 @@ def parse_args() -> argparse.Namespace:
|
||||
"examined and removed.")
|
||||
parser.add_argument(
|
||||
"--threshold", dest="threshold_days", type=int, default=14,
|
||||
nargs="?", metavar="<days>", help="Deployments older than "
|
||||
metavar="<days>", help="Deployments older than "
|
||||
"threshold days will be deleted. (defaults to 14)")
|
||||
parser.add_argument(
|
||||
"--dry-run", action="store_true",
|
||||
|
||||
@@ -22,9 +22,7 @@ class Command(ZulipBaseCommand):
|
||||
return parser
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument(
|
||||
"--output", default=None, nargs="?", help="Filename of output tarball",
|
||||
)
|
||||
parser.add_argument("--output", default=None, help="Filename of output tarball")
|
||||
parser.add_argument("--skip-db", action='store_true', help="Skip database backup")
|
||||
parser.add_argument("--skip-uploads", action='store_true', help="Skip uploads backup")
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class Command(BaseCommand):
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
parser.add_argument('--queue_name', metavar='<queue name>', type=str,
|
||||
help="queue to process")
|
||||
parser.add_argument('--worker_num', metavar='<worker number>', type=int, nargs='?', default=0,
|
||||
parser.add_argument('--worker_num', metavar='<worker number>', type=int, default=0,
|
||||
help="worker label")
|
||||
parser.add_argument('--all', action="store_true",
|
||||
help="run all queues")
|
||||
|
||||
Reference in New Issue
Block a user