Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

python: Elide default for store_{true,false} argparse arguments.

Anders Kaseorgb4597a8ca806
diff --git a/analytics/management/commands/update_analytics_counts.py b/analytics/management/commands/update_analytics_counts.py
index 1acd1e6f5b3..df72714b17c 100644
--- a/analytics/management/commands/update_analytics_counts.py
+++ b/analytics/management/commands/update_analytics_counts.py
@@ -29,15 +29,13 @@ class Command(BaseCommand):
default=timezone_now().isoformat())
parser.add_argument('--utc',
action='store_true',
- help="Interpret --time in UTC.",
- default=False)
+ help="Interpret --time in UTC.")
parser.add_argument('--stat', '-s',
type=str,
help="CountStat to process. If omitted, all stats are processed.")
parser.add_argument('--verbose',
action='store_true',
- help="Print timing information to stdout.",
- default=False)
+ help="Print timing information to stdout.")
def handle(self, *args: Any, **options: Any) -> None:
try:
diff --git a/scripts/lib/email-mirror-postfix b/scripts/lib/email-mirror-postfix
index 3b04f9dc916..e5df625ae99 100755
--- a/scripts/lib/email-mirror-postfix
+++ b/scripts/lib/email-mirror-postfix
@@ -67,10 +67,10 @@ parser.add_argument('-d', '--dst-host', dest="host", type=str, default='https://
parser.add_argument('-u', '--dst-url', dest="url", type=str, default='/email_mirror_message',
help="Destination relative url for uploading email from email mirror.")
-parser.add_argument('-n', '--not-verify-ssl', dest="verify_ssl", action='store_false', default=True,
+parser.add_argument('-n', '--not-verify-ssl', dest="verify_ssl", action='store_false',
help="Disable ssl certificate verifying for self-signed certificates")
-parser.add_argument('-t', '--test', action='store_true', default=False,
+parser.add_argument('-t', '--test', action='store_true',
help="Test mode.")
options = parser.parse_args()
diff --git a/scripts/restart-server b/scripts/restart-server
index d0937e14cef..3bafb4fa592 100755
--- a/scripts/restart-server
+++ b/scripts/restart-server
@@ -17,7 +17,7 @@ logging.basicConfig(format="%(asctime)s restart-server: %(message)s",
level=logging.INFO)
parser = argparse.ArgumentParser()
-parser.add_argument('--fill-cache', action='store_true', default=False,
+parser.add_argument('--fill-cache', action='store_true',
help='Fill the memcached caches')
args = parser.parse_args()
diff --git a/tools/check-capitalization b/tools/check-capitalization
index 90bd806aa00..0c9370b7034 100755
--- a/tools/check-capitalization
+++ b/tools/check-capitalization
@@ -21,11 +21,11 @@ DJANGO_PO_REGEX = re.compile('msgid "(.*?)"')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--show-ignored',
- action='store_true', default=False,
+ action='store_true',
help='Show strings that passed the check because they '
'contained ignored phrases.')
parser.add_argument('--no-generate',
- action='store_true', default=False,
+ action='store_true',
help="Don't run makemessages command.")
args = parser.parse_args()
diff --git a/tools/check-frontend-i18n b/tools/check-frontend-i18n
index b1890d15d77..1fa3830ce85 100755
--- a/tools/check-frontend-i18n
+++ b/tools/check-frontend-i18n
@@ -26,7 +26,7 @@ def find_handlebars(translatable_strings: List[str]) -> List[str]:
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--no-generate',
- action='store_true', default=False,
+ action='store_true',
help="Don't run makemessages command.")
args = parser.parse_args()
diff --git a/tools/check-issue-labels b/tools/check-issue-labels
index 43b4a97a499..1ecf5a09bba 100755
--- a/tools/check-issue-labels
+++ b/tools/check-issue-labels
@@ -44,7 +44,7 @@ def get_next_page_url(link_header: str) -> Optional[str]:
def check_issue_labels() -> None:
parser = argparse.ArgumentParser()
- parser.add_argument('--force', action="store_true", default=False)
+ parser.add_argument('--force', action="store_true")
args = parser.parse_args()
if not args.force:
diff --git a/tools/check-provision b/tools/check-provision
index fe64e18daa0..9a6ad52aeaf 100755
--- a/tools/check-provision
+++ b/tools/check-provision
@@ -12,7 +12,7 @@ from tools.lib.test_script import assert_provisioning_status_ok
def run() -> None:
parser = argparse.ArgumentParser()
- parser.add_argument('--force', default=False,
+ parser.add_argument('--force',
action="store_true",
help='Run tests despite possible problems.')
options = parser.parse_args()
diff --git a/tools/check-templates b/tools/check-templates
index dbcc7f9c651..59e6cc840a2 100755
--- a/tools/check-templates
+++ b/tools/check-templates
@@ -156,13 +156,13 @@ def check_handlebar_templates(templates: Iterable[str], fix: bool) -> None:
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('-m', '--modified',
- action='store_true', default=False,
+ action='store_true',
help='only check modified files')
parser.add_argument('--all-dups',
- action="store_true", default=False,
+ action="store_true",
help='Run lint tool to detect duplicate ids on ignored files as well')
parser.add_argument('--fix',
- action='store_true', default=False,
+ action='store_true',
help='Automatically fix indentation problems.')
parser.add_argument('targets', nargs=argparse.REMAINDER)
args = parser.parse_args()
diff --git a/tools/droplets/add_mentor.py b/tools/droplets/add_mentor.py
index 5ab63bef36b..488908bb31a 100644
--- a/tools/droplets/add_mentor.py
+++ b/tools/droplets/add_mentor.py
@@ -21,7 +21,7 @@ import requests
parser = ArgumentParser(description='Give a mentor ssh access to this machine.')
parser.add_argument('username', help='Github username of the mentor.')
parser.add_argument('--remove', help='Remove his/her key from the machine.',
- action='store_true', default=False)
+ action='store_true')
# Wrap keys with line comments for easier key removal.
append_key = """\
diff --git a/tools/droplets/create.py b/tools/droplets/create.py
index f62dee8c82a..20ce311a450 100644
--- a/tools/droplets/create.py
+++ b/tools/droplets/create.py
@@ -30,7 +30,7 @@ import digitalocean
parser = argparse.ArgumentParser(description='Create a Zulip devopment VM DigitalOcean droplet.')
parser.add_argument("username", help="Github username for whom you want to create a Zulip dev droplet")
parser.add_argument('--tags', nargs='+', default=[])
-parser.add_argument('-f', '--recreate', action="store_true", default=False)
+parser.add_argument('-f', '--recreate', action="store_true")
def get_config() -> configparser.ConfigParser:
config = configparser.ConfigParser()
diff --git a/tools/generate-integration-docs-screenshot b/tools/generate-integration-docs-screenshot
index 915ee2bc03d..7bd845c2541 100755
--- a/tools/generate-integration-docs-screenshot
+++ b/tools/generate-integration-docs-screenshot
@@ -193,7 +193,7 @@ def generate_screenshot_from_config(integration_name: str, screenshot_config: Sc
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group(required=True)
-group.add_argument('--all', default=False, action='store_true')
+group.add_argument('--all', action='store_true')
group.add_argument('--integration', type=str, help='Name of the integration')
parser.add_argument('--fixture', type=str, help='Name of the fixture file to use')
parser.add_argument('--image-name', type=str, help='Name for the screenshot image')
diff --git a/tools/lib/provision.py b/tools/lib/provision.py
index 7cf6aeff2a6..29bef1d740c 100755
--- a/tools/lib/provision.py
+++ b/tools/lib/provision.py
@@ -421,16 +421,13 @@ if __name__ == "__main__":
description = ("Provision script to install Zulip")
parser = argparse.ArgumentParser(description=description)
parser.add_argument('--force', action='store_true', dest='is_force',
- default=False,
help="Ignore all provisioning optimizations.")
parser.add_argument('--build-release-tarball-only', action='store_true',
dest='is_build_release_tarball_only',
- default=False,
help="Provision needed to build release tarball.")
parser.add_argument('--skip-dev-db-build', action='store_true',
- default=False,
help="Don't run migrations on dev database.")
options = parser.parse_args()
diff --git a/tools/lib/provision_inner.py b/tools/lib/provision_inner.py
index 34eaa6f82ae..573c37be7b6 100755
--- a/tools/lib/provision_inner.py
+++ b/tools/lib/provision_inner.py
@@ -328,16 +328,13 @@ def main(options: argparse.Namespace) -> int:
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--force', action='store_true', dest='is_force',
- default=False,
help="Ignore all provisioning optimizations.")
parser.add_argument('--build-release-tarball-only', action='store_true',
dest='is_build_release_tarball_only',
- default=False,
help="Provision for test suite with production settings.")
parser.add_argument('--skip-dev-db-build', action='store_true',
- default=False,
help="Don't run migrations on dev database.")
options = parser.parse_args()
diff --git a/tools/lint b/tools/lint
index 6f2aef5a9da..cc6506d0603 100755
--- a/tools/lint
+++ b/tools/lint
@@ -16,7 +16,7 @@ from linter_lib.custom_check import non_py_rules, python_rules
def run() -> None:
parser = argparse.ArgumentParser()
- parser.add_argument('--force', default=False,
+ parser.add_argument('--force',
action="store_true",
help='Run tests despite possible problems.')
parser.add_argument('--full',
diff --git a/tools/run-dev.py b/tools/run-dev.py
index 46946d65ca6..4752d2c5599 100755
--- a/tools/run-dev.py
+++ b/tools/run-dev.py
@@ -52,16 +52,16 @@ parser.add_argument('--interface',
default=None, help='Set the IP or hostname for the proxy to listen on')
parser.add_argument('--no-clear-memcached',
action='store_false', dest='clear_memcached',
- default=True, help='Do not clear memcached')
+ help='Do not clear memcached')
parser.add_argument('--streamlined',
action="store_true",
- default=False, help='Avoid thumbor, etc.')
+ help='Avoid thumbor, etc.')
parser.add_argument('--force',
action="store_true",
- default=False, help='Run command despite possible problems.')
+ help='Run command despite possible problems.')
parser.add_argument('--enable-tornado-logging',
action="store_true",
- default=False, help='Enable access logs from tornado proxy server.')
+ help='Enable access logs from tornado proxy server.')
options = parser.parse_args()
assert_provisioning_status_ok(options.force)
diff --git a/tools/test-api b/tools/test-api
index bc619795bce..674040c0b2c 100755
--- a/tools/test-api
+++ b/tools/test-api
@@ -23,7 +23,7 @@ usage = """test-api [options]"""
parser = argparse.ArgumentParser(usage)
parser.add_argument('--force',
action="store_true",
- default=False, help='Run tests despite possible provisioning problems.')
+ help='Run tests despite possible provisioning problems.')
options = parser.parse_args()
assert_provisioning_status_ok(options.force)
diff --git a/tools/test-backend b/tools/test-backend
index 15d624f2b4a..3c3b294ae99 100755
--- a/tools/test-backend
+++ b/tools/test-backend
@@ -209,18 +209,16 @@ def main() -> None:
parser = argparse.ArgumentParser(description=usage,
formatter_class=argparse.RawTextHelpFormatter)
- parser.add_argument('--nonfatal-errors', action="store_false", default=True,
+ parser.add_argument('--nonfatal-errors', action="store_false",
dest="fatal_errors", help="Continue past test failures to run all tests")
parser.add_argument('--coverage',
action="store_true",
- default=False,
help='Compute test coverage.')
parser.add_argument('--verbose-coverage',
action="store_true",
- default=False, help='Enable verbose print of coverage report.')
+ help='Enable verbose print of coverage report.')
parser.add_argument('--no-cov-cleanup',
action='store_true',
- default=False,
help="Do not clean generated coverage files.")
parser.add_argument('--parallel', dest='processes',
@@ -231,39 +229,33 @@ def main() -> None:
'tests in. Default is the number of logical CPUs')
parser.add_argument('--profile',
action="store_true",
- default=False, help='Profile test runtime.')
+ help='Profile test runtime.')
parser.add_argument('--force',
action="store_true",
- default=False, help='Run tests despite possible problems.')
+ help='Run tests despite possible problems.')
parser.add_argument('--no-shallow',
action="store_true",
- default=False,
help="Don't allow shallow testing of templates (deprecated)")
parser.add_argument('--verbose',
action="store_true",
- default=False,
help="Show detailed output")
parser.add_argument('--reverse',
action="store_true",
- default=False,
help="Run tests in reverse order.")
parser.add_argument('--rerun',
action="store_true",
- default=False,
help=("Run the tests which failed the last time "
"test-backend was run. Implies --nonfatal-errors."))
parser.add_argument('--include-webhooks',
action="store_true",
- default=False,
help=("Include webhook tests. By default, they are skipped for performance."))
parser.add_argument('--generate-stripe-fixtures',
action="store_true",
- default=False,
help=("Generate Stripe test fixtures by making requests to Stripe test network"))
parser.add_argument('args', nargs='*')
parser.add_argument('--ban-console-output',
action="store_true",
- default=False, help='Require stdout and stderr to be clean of unexpected output.')
+ help='Require stdout and stderr to be clean of unexpected output.')
options = parser.parse_args()
if options.ban_console_output:
diff --git a/tools/test-help-documentation b/tools/test-help-documentation
index 138de54ac50..f8c76b93655 100755
--- a/tools/test-help-documentation
+++ b/tools/test-help-documentation
@@ -14,10 +14,10 @@ from lib import sanity_check
sanity_check.check_venv(__file__)
parser = argparse.ArgumentParser()
-parser.add_argument('--force', default=False,
+parser.add_argument('--force',
action="store_true",
help='Run tests despite possible problems.')
-parser.add_argument('--skip-external-links', default=False,
+parser.add_argument('--skip-external-links',
dest="skip_external_link_check",
action="store_true",
help='Skip checking of external links.')
diff --git a/tools/test-js-with-node b/tools/test-js-with-node
index 6ad5f4dd9cc..06bc1a0ebb2 100755
--- a/tools/test-js-with-node
+++ b/tools/test-js-with-node
@@ -166,10 +166,10 @@ EXEMPT_FILES = {
parser = argparse.ArgumentParser(USAGE)
parser.add_argument('--coverage',
action="store_true",
- default=False, help='Get coverage report')
+ help='Get coverage report')
parser.add_argument('--force',
action="store_true",
- default=False, help='Run tests despite possible problems.')
+ help='Run tests despite possible problems.')
parser.add_argument('args', nargs=argparse.REMAINDER)
options = parser.parse_args()
individual_files = options.args
diff --git a/tools/test-js-with-puppeteer b/tools/test-js-with-puppeteer
index 79e2e5e0757..51613920435 100755
--- a/tools/test-js-with-puppeteer
+++ b/tools/test-js-with-puppeteer
@@ -29,10 +29,10 @@ parser = argparse.ArgumentParser(usage)
parser.add_argument('--interactive',
action="store_true",
- default=False, help='Run tests interactively')
+ help='Run tests interactively')
parser.add_argument('--force',
action="store_true",
- default=False, help='Run tests despite possible problems.')
+ help='Run tests despite possible problems.')
parser.add_argument('tests', nargs=argparse.REMAINDER,
help='Specific tests to run; by default, runs all tests')
diff --git a/tools/test-tools b/tools/test-tools
index 2e6476c0a48..ef22e1f81e0 100755
--- a/tools/test-tools
+++ b/tools/test-tools
@@ -13,7 +13,7 @@ if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('--coverage',
action="store_true",
- default=False, help='compute test coverage')
+ help='compute test coverage')
args = parser.parse_args()
def dir_join(dir1: str, dir2: str) -> str:
diff --git a/tools/webpack b/tools/webpack
index 3735212c65e..4d743f24fb1 100755
--- a/tools/webpack
+++ b/tools/webpack
@@ -112,13 +112,13 @@ def build_for_most_tests() -> None:
parser = argparse.ArgumentParser()
parser.add_argument('--test',
- action='store_true', default=False,
+ action='store_true',
help='generate a stub webpack-stats.json file (for backend testing)')
parser.add_argument('--quiet',
- action='store_true', default=False,
+ action='store_true',
help='Minimizes webpack output while running')
parser.add_argument('--watch',
- action='store_true', default=False,
+ action='store_true',
help='watch for changes to source files (for development)')
parser.add_argument('--host',
action='store',
@@ -127,10 +127,10 @@ parser.add_argument('--port',
action='store',
default='9994', help='set the port for the webpack server to run on')
parser.add_argument('--minify',
- action='store_true', default=False,
+ action='store_true',
help='Minify and optimize the assets (for development)')
parser.add_argument('--disable-host-check',
- action='store_true', default=None,
+ action='store_true',
help='Disable host check for webpack-dev-server')
args = parser.parse_args()
diff --git a/zerver/lib/management.py b/zerver/lib/management.py
index 45ff73bc731..0b5173ac4cd 100644
--- a/zerver/lib/management.py
+++ b/zerver/lib/management.py
@@ -65,7 +65,6 @@ You can use the command list_realms to find ID of the realms in this server."""
parser.add_argument(
'-a', '--all-users',
action="store_true",
- default=False,
help=all_users_help)
def get_realm(self, options: Dict[str, Any]) -> Optional[Realm]:
diff --git a/zerver/management/commands/check_redis.py b/zerver/management/commands/check_redis.py
index 9de6cbb23ef..dc9f4e0838c 100644
--- a/zerver/management/commands/check_redis.py
+++ b/zerver/management/commands/check_redis.py
@@ -17,7 +17,6 @@ class Command(BaseCommand):
def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument('-t', '--trim',
- default=False,
action='store_true',
help="Actually trim excess")
diff --git a/zerver/management/commands/compilemessages.py b/zerver/management/commands/compilemessages.py
index 2dc19a919a4..f1de9273300 100644
--- a/zerver/management/commands/compilemessages.py
+++ b/zerver/management/commands/compilemessages.py
@@ -23,7 +23,6 @@ class Command(compilemessages.Command):
parser.add_argument(
'--strict', '-s',
action='store_true',
- default=False,
help='Stop execution in case of errors.')
def handle(self, *args: Any, **options: Any) -> None:
diff --git a/zerver/management/commands/create_user.py b/zerver/management/commands/create_user.py
index c34794fff86..01e6eff828e 100644
--- a/zerver/management/commands/create_user.py
+++ b/zerver/management/commands/create_user.py
@@ -24,7 +24,6 @@ Omit both <email> and <full name> for interactive user creation.
parser.add_argument('--this-user-has-accepted-the-tos',
dest='tos',
action="store_true",
- default=False,
help='Acknowledgement that the user has already accepted the ToS.')
parser.add_argument('--password',
type=str,
diff --git a/zerver/management/commands/deactivate_user.py b/zerver/management/commands/deactivate_user.py
index 6ae6643d8aa..094ba8ea616 100644
--- a/zerver/management/commands/deactivate_user.py
+++ b/zerver/management/commands/deactivate_user.py
@@ -13,7 +13,6 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('-f', '--for-real',
action='store_true',
- default=False,
help="Actually deactivate the user. Default is a dry run.")
parser.add_argument('email', metavar='<email>', type=str,
help='email of user to deactivate')
diff --git a/zerver/management/commands/delete_old_unclaimed_attachments.py b/zerver/management/commands/delete_old_unclaimed_attachments.py
index 291ff748578..1e6ccf74f01 100644
--- a/zerver/management/commands/delete_old_unclaimed_attachments.py
+++ b/zerver/management/commands/delete_old_unclaimed_attachments.py
@@ -21,7 +21,6 @@ class Command(BaseCommand):
parser.add_argument('-f', '--for-real',
action='store_true',
- default=False,
help="Actually remove the files from the storage.")
def handle(self, *args: Any, **options: Any) -> None:
diff --git a/zerver/management/commands/fix_unreads.py b/zerver/management/commands/fix_unreads.py
index 112dd77bf51..9d2df7983fb 100644
--- a/zerver/management/commands/fix_unreads.py
+++ b/zerver/management/commands/fix_unreads.py
@@ -21,7 +21,6 @@ class Command(ZulipBaseCommand):
help='email address to spelunk')
parser.add_argument('--all',
action='store_true',
- default=False,
help='fix all users in specified realm')
self.add_realm_args(parser)
diff --git a/zerver/management/commands/generate_invite_links.py b/zerver/management/commands/generate_invite_links.py
index 1a62ae0e561..64bd3fa8bfd 100644
--- a/zerver/management/commands/generate_invite_links.py
+++ b/zerver/management/commands/generate_invite_links.py
@@ -15,7 +15,6 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('--force',
action="store_true",
- default=False,
help='Override that the domain is restricted to external users.')
parser.add_argument('emails', metavar='<email>', type=str, nargs='*',
help='email of users to generate an activation link for')
diff --git a/zerver/management/commands/import.py b/zerver/management/commands/import.py
index c56ccb35c8f..1ede79de29e 100644
--- a/zerver/management/commands/import.py
+++ b/zerver/management/commands/import.py
@@ -19,12 +19,10 @@ import a database dump from one or more JSON files."""
def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument('--destroy-rebuild-database',
- default=False,
action="store_true",
help='Destroys and rebuilds the databases prior to import.')
parser.add_argument('--import-into-nonempty',
- default=False,
action="store_true",
help='Import into an existing nonempty database.')
diff --git a/zerver/management/commands/knight.py b/zerver/management/commands/knight.py
index 401589aa458..3dac43e0ac2 100644
--- a/zerver/management/commands/knight.py
+++ b/zerver/management/commands/knight.py
@@ -18,12 +18,10 @@ ONLY perform this on customer request from an authorized person.
parser.add_argument('-f', '--for-real',
dest='ack',
action="store_true",
- default=False,
help='Acknowledgement that this is done according to policy.')
parser.add_argument('--revoke',
dest='grant',
action="store_false",
- default=True,
help='Remove an administrator\'s rights.')
parser.add_argument('--permission',
action="store",
diff --git a/zerver/management/commands/list_realms.py b/zerver/management/commands/list_realms.py
index 9b0afd123aa..80f556a3178 100644
--- a/zerver/management/commands/list_realms.py
+++ b/zerver/management/commands/list_realms.py
@@ -17,7 +17,6 @@ Usage examples:
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument("--all",
action="store_true",
- default=False,
help="Print all the configuration settings of the realms.")
def handle(self, *args: Any, **options: Any) -> None:
diff --git a/zerver/management/commands/logout_all_users.py b/zerver/management/commands/logout_all_users.py
index b41b1c867c2..594ff08a6f8 100644
--- a/zerver/management/commands/logout_all_users.py
+++ b/zerver/management/commands/logout_all_users.py
@@ -15,7 +15,6 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('--deactivated-only',
action='store_true',
- default=False,
help="Only logout all users who are deactivated")
self.add_realm_args(parser, help="Only logout all users in a particular realm")
diff --git a/zerver/management/commands/process_queue.py b/zerver/management/commands/process_queue.py
index 0eb6fb35025..c2656084231 100644
--- a/zerver/management/commands/process_queue.py
+++ b/zerver/management/commands/process_queue.py
@@ -19,7 +19,7 @@ class Command(BaseCommand):
help="queue to process")
parser.add_argument('--worker_num', metavar='<worker number>', type=int, nargs='?', default=0,
help="worker label")
- parser.add_argument('--all', action="store_true", default=False,
+ parser.add_argument('--all', action="store_true",
help="run all queues")
parser.add_argument('--multi_threaded', nargs='+',
metavar='<list of queue name>',
diff --git a/zerver/management/commands/purge_queue.py b/zerver/management/commands/purge_queue.py
index efad754045c..77388ed4352 100644
--- a/zerver/management/commands/purge_queue.py
+++ b/zerver/management/commands/purge_queue.py
@@ -13,7 +13,7 @@ class Command(BaseCommand):
parser.add_argument(dest="queue_name", type=str, nargs='?',
help="queue to purge", default=None)
parser.add_argument('--all', action="store_true",
- default=False, help="purge all queues")
+ help="purge all queues")
help = "Discards all messages from the given queue"
diff --git a/zerver/management/commands/rate_limit.py b/zerver/management/commands/rate_limit.py
index 51fe41177ec..a26ae1db6bd 100644
--- a/zerver/management/commands/rate_limit.py
+++ b/zerver/management/commands/rate_limit.py
@@ -24,7 +24,6 @@ class Command(ZulipBaseCommand):
parser.add_argument('-b', '--all-bots',
dest='bots',
action='store_true',
- default=False,
help="Whether or not to also block all bots for this user.")
parser.add_argument('operation', metavar='<operation>', type=str, choices=['block', 'unblock'],
help="operation to perform (block or unblock)")
diff --git a/zerver/management/commands/realm_domain.py b/zerver/management/commands/realm_domain.py
index 1ea248ab3eb..ce608b9c750 100644
--- a/zerver/management/commands/realm_domain.py
+++ b/zerver/management/commands/realm_domain.py
@@ -20,7 +20,6 @@ class Command(ZulipBaseCommand):
help='What operation to do (add, show, remove).')
parser.add_argument('--allow-subdomains',
action="store_true",
- default=False,
help='Whether subdomains are allowed or not.')
parser.add_argument('domain', metavar='<domain>', type=str, nargs='?',
help="domain to add or remove")
diff --git a/zerver/management/commands/register_server.py b/zerver/management/commands/register_server.py
index 61d23897e0e..5979df11f2e 100644
--- a/zerver/management/commands/register_server.py
+++ b/zerver/management/commands/register_server.py
@@ -21,11 +21,9 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('--agree_to_terms_of_service',
action='store_true',
- default=False,
help="Agree to the Zulipchat Terms of Service: https://zulip.com/terms/.")
parser.add_argument('--rotate-key',
action='store_true',
- default=False,
help="Automatically rotate your server's zulip_org_key")
def handle(self, **options: Any) -> None:
diff --git a/zerver/management/commands/runtornado.py b/zerver/management/commands/runtornado.py
index e82f3d52ddd..1f7ffa67a96 100644
--- a/zerver/management/commands/runtornado.py
+++ b/zerver/management/commands/runtornado.py
@@ -46,11 +46,11 @@ class Command(BaseCommand):
'(use multiple ports to start multiple servers)')
parser.add_argument('--nokeepalive', action='store_true',
- dest='no_keep_alive', default=False,
+ dest='no_keep_alive',
help="Tells Tornado to NOT keep alive http connections.")
parser.add_argument('--noxheaders', action='store_false',
- dest='xheaders', default=True,
+ dest='xheaders',
help="Tells Tornado to NOT override remote IP with X-Real-IP.")
def handle(self, addrport: str, **options: bool) -> None:
diff --git a/zerver/management/commands/send_custom_email.py b/zerver/management/commands/send_custom_email.py
index 72d58de06c4..d22b2a265f3 100644
--- a/zerver/management/commands/send_custom_email.py
+++ b/zerver/management/commands/send_custom_email.py
@@ -16,7 +16,7 @@ class Command(ZulipBaseCommand):
document used to generate the email, or on the command line."""
def add_arguments(self, parser: ArgumentParser) -> None:
- parser.add_argument('--entire-server', action="store_true", default=False,
+ parser.add_argument('--entire-server', action="store_true",
help="Send to every user on the server.")
parser.add_argument('--markdown-template-path', '--path',
required=True,
diff --git a/zerver/management/commands/send_password_reset_email.py b/zerver/management/commands/send_password_reset_email.py
index 45e28ae0aef..a1a707b8bb9 100644
--- a/zerver/management/commands/send_password_reset_email.py
+++ b/zerver/management/commands/send_password_reset_email.py
@@ -13,7 +13,7 @@ class Command(ZulipBaseCommand):
help = """Send email to specified email address."""
def add_arguments(self, parser: ArgumentParser) -> None:
- parser.add_argument('--entire-server', action="store_true", default=False,
+ parser.add_argument('--entire-server', action="store_true",
help="Send to every user on the server. ")
self.add_user_list_args(parser,
help="Email addresses of user(s) to send password reset emails to.",
diff --git a/zerver/management/commands/set_message_flags.py b/zerver/management/commands/set_message_flags.py
index 9fb5258698e..7faca0f37f7 100644
--- a/zerver/management/commands/set_message_flags.py
+++ b/zerver/management/commands/set_message_flags.py
@@ -17,7 +17,6 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: CommandParser) -> None:
parser.add_argument('-l', '--for-real',
action='store_true',
- default=False,
help="Actually change message flags. Default is a dry run.")
parser.add_argument('-f', '--flag',
diff --git a/zerver/management/commands/soft_deactivate_users.py b/zerver/management/commands/soft_deactivate_users.py
index 2425983d8f9..615f50a6722 100644
--- a/zerver/management/commands/soft_deactivate_users.py
+++ b/zerver/management/commands/soft_deactivate_users.py
@@ -39,11 +39,9 @@ class Command(ZulipBaseCommand):
self.add_realm_args(parser)
parser.add_argument('-d', '--deactivate',
action='store_true',
- default=False,
help='Used to deactivate user/users.')
parser.add_argument('-a', '--activate',
action='store_true',
- default=False,
help='Used to activate user/users.')
parser.add_argument('--inactive-for',
type=int,
diff --git a/zerver/management/commands/sync_ldap_user_data.py b/zerver/management/commands/sync_ldap_user_data.py
index 35f6450f8e7..e4b956bc9cb 100644
--- a/zerver/management/commands/sync_ldap_user_data.py
+++ b/zerver/management/commands/sync_ldap_user_data.py
@@ -54,7 +54,6 @@ class Command(ZulipBaseCommand):
def add_arguments(self, parser: ArgumentParser) -> None:
parser.add_argument('-f', '--force',
action="store_true",
- default=False,
help='Disable the protection against deactivating all users.')
self.add_realm_args(parser)
diff --git a/zilencer/management/commands/populate_db.py b/zilencer/management/commands/populate_db.py
index 5ea2a7ae3d7..4e1de6dfcc0 100644
--- a/zilencer/management/commands/populate_db.py
+++ b/zilencer/management/commands/populate_db.py
@@ -223,12 +223,10 @@ class Command(BaseCommand):
parser.add_argument('--nodelete',
action="store_false",
- default=True,
dest='delete',
help='Whether to delete all the existing messages.')
parser.add_argument('--test-suite',
- default=False,
action="store_true",
help='Configures populate_db to create a deterministic '
'data set for the backend tests.')