mirror of
https://github.com/zulip/zulip.git
synced 2025-11-20 14:38:46 +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(
|
parser.add_argument(
|
||||||
"--threshold", dest="threshold_days", type=int, default=14,
|
"--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 "
|
"use by a deployment not older than threshold days(current "
|
||||||
"installation in dev) and older than threshold days will be "
|
"installation in dev) and older than threshold days will be "
|
||||||
"deleted. (defaults to 14)")
|
"deleted. (defaults to 14)")
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ def parse_args() -> argparse.Namespace:
|
|||||||
"examined and removed.")
|
"examined and removed.")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--threshold", dest="threshold_days", type=int, default=14,
|
"--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)")
|
"threshold days will be deleted. (defaults to 14)")
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"--dry-run", action="store_true",
|
"--dry-run", action="store_true",
|
||||||
|
|||||||
@@ -22,9 +22,7 @@ class Command(ZulipBaseCommand):
|
|||||||
return parser
|
return parser
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
parser.add_argument(
|
parser.add_argument("--output", default=None, help="Filename of output tarball")
|
||||||
"--output", default=None, nargs="?", help="Filename of output tarball",
|
|
||||||
)
|
|
||||||
parser.add_argument("--skip-db", action='store_true', help="Skip database backup")
|
parser.add_argument("--skip-db", action='store_true', help="Skip database backup")
|
||||||
parser.add_argument("--skip-uploads", action='store_true', help="Skip uploads 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:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
parser.add_argument('--queue_name', metavar='<queue name>', type=str,
|
parser.add_argument('--queue_name', metavar='<queue name>', type=str,
|
||||||
help="queue to process")
|
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")
|
help="worker label")
|
||||||
parser.add_argument('--all', action="store_true",
|
parser.add_argument('--all', action="store_true",
|
||||||
help="run all queues")
|
help="run all queues")
|
||||||
|
|||||||
Reference in New Issue
Block a user