python: Elide type=str from argparse arguments.

This commit is contained in:
Alex Vandiver
2025-10-17 18:25:09 +00:00
committed by Tim Abbott
parent ca01de84be
commit 1e943ae7df
5 changed files with 1 additions and 11 deletions

View File

@@ -246,7 +246,6 @@ group = parser.add_mutually_exclusive_group(required=True)
group.add_argument( group.add_argument(
"--thread", "--thread",
nargs="+", nargs="+",
type=str,
help="Path of the file where the thread for screenshot is present", help="Path of the file where the thread for screenshot is present",
) )
fixture_group = parser.add_argument_group("thread") fixture_group = parser.add_argument_group("thread")

View File

@@ -17,12 +17,10 @@ class Command(ZulipBaseCommand):
group = parser.add_mutually_exclusive_group(required=True) group = parser.add_mutually_exclusive_group(required=True)
group.add_argument( group.add_argument(
"--enable", "--enable",
type=str,
help="Name of the authentication backend to enable", help="Name of the authentication backend to enable",
) )
group.add_argument( group.add_argument(
"--disable", "--disable",
type=str,
help="Name of the authentication backend to disable", help="Name of the authentication backend to disable",
) )
group.add_argument( group.add_argument(

View File

@@ -20,13 +20,11 @@ class Command(BaseCommand):
parser.add_argument( parser.add_argument(
"--user", "--user",
help="User to drop privileges to, if started as root.", help="User to drop privileges to, if started as root.",
type=str,
required=(os.geteuid() == 0), required=(os.geteuid() == 0),
) )
parser.add_argument( parser.add_argument(
"--group", "--group",
help="Group to drop privileges to, if started as root.", help="Group to drop privileges to, if started as root.",
type=str,
required=(os.geteuid() == 0), required=(os.geteuid() == 0),
) )
tls_cert: str | None = None tls_cert: str | None = None
@@ -44,13 +42,11 @@ class Command(BaseCommand):
parser.add_argument( parser.add_argument(
"--tls-cert", "--tls-cert",
help="Path to TLS certificate chain file", help="Path to TLS certificate chain file",
type=str,
default=tls_cert, default=tls_cert,
) )
parser.add_argument( parser.add_argument(
"--tls-key", "--tls-key",
help="Path to TLS private key file", help="Path to TLS private key file",
type=str,
default=tls_key, default=tls_key,
) )

View File

@@ -14,9 +14,7 @@ class Command(BaseCommand):
@override @override
def add_arguments(self, parser: CommandParser) -> None: def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument( parser.add_argument("listen", help="[Port, or address:port, to bind HTTP server to]")
"listen", help="[Port, or address:port, to bind HTTP server to]", type=str
)
local_port = 80 local_port = 80
config_file = get_config_file() config_file = get_config_file()
if get_config(config_file, "application_server", "http_only", False): if get_config(config_file, "application_server", "http_only", False):

View File

@@ -29,7 +29,6 @@ Usage:
) )
parser.add_argument( parser.add_argument(
"--remove-key", "--remove-key",
type=str,
metavar="PUBLIC_KEY", metavar="PUBLIC_KEY",
help="Remove the key pair associated with the given public key from the `push_registration_encryption_keys` map.", help="Remove the key pair associated with the given public key from the `push_registration_encryption_keys` map.",
) )