#NEWLINE# def prepare_and_parse_args( plugins , args , detect_defaults = False ) : #NEWLINE# #INDENT# 'Returns parsed command line arguments.\n\n    :param .PluginsRegistry plugins: available plugins\n    :param list args: command line arguments with the program name removed\n\n    :returns: parsed command line arguments\n    :rtype: argparse.Namespace\n\n    ' #NEWLINE# helpful = HelpfulArgumentParser ( args , plugins , detect_defaults ) #NEWLINE# helpful . add ( None , '-v' , '--verbose' , dest = 'verbose_count' , action = 'count' , default = flag_default ( 'verbose_count' ) , help = 'This flag can be used multiple times to incrementally increase the verbosity of output, e.g. -vvv.' ) #NEWLINE# helpful . add ( None , '-t' , '--text' , dest = 'text_mode' , action = 'store_true' , help = 'Use the text output instead of the curses UI.' ) #NEWLINE# helpful . add ( None , '-n' , '--non-interactive' , '--noninteractive' , dest = 'noninteractive_mode' , action = 'store_true' , help = 'Run without ever asking for user input. This may require additional command line flags; the client will try to explain which ones are required if it finds one missing' ) #NEWLINE# helpful . add ( None , '--dry-run' , action = 'store_true' , dest = 'dry_run' , help = "Perform a test run of the client, obtaining test (invalid) certs but not saving them to disk. This can currently only be used with the 'certonly' and 'renew' subcommands. \nNote: Although --dry-run tries to avoid making any persistent changes on a system, it  is not completely side-effect free: if used with webserver authenticator plugins like apache and nginx, it makes and then reverts temporary config changes in order to obtain test certs, and reloads webservers to deploy and then roll back those changes.  It also calls --pre-hook and --post-hook commands if they are defined because they may be necessary to accurately simulate renewal. --renew-hook commands are not called." ) #NEWLINE# helpful . add ( None , '--register-unsafely-without-email' , action = 'store_true' , help = 'Specifying this flag enables registering an account with no email address. This is strongly discouraged, because in the event of key loss or account compromise you will irrevocably lose access to your account. You will also be unable to receive notice about impending expiration or revocation of your certificates. Updates to the Subscriber Agreement will still affect you, and will be effective 14 days after posting an update to the web site.' ) #NEWLINE# helpful . add ( None , '-m' , '--email' , help = config_help ( 'email' ) ) #NEWLINE# helpful . add ( None , '-d' , '--domains' , '--domain' , dest = 'domains' , metavar = 'DOMAIN' , action = _DomainsAction , default = [ ] , help = 'Domain names to apply. For multiple domains you can use multiple -d flags or enter a comma separated list of domains as a parameter.' ) #NEWLINE# helpful . add_group ( 'automation' , description = 'Arguments for automating execution & other tweaks' ) #NEWLINE# helpful . add ( 'automation' , '--keep-until-expiring' , '--keep' , '--reinstall' , dest = 'reinstall' , action = 'store_true' , help = "If the requested cert matches an existing cert, always keep the existing one until it is due for renewal (for the 'run' subcommand this means reinstall the existing cert)" ) #NEWLINE# helpful . add ( 'automation' , '--expand' , action = 'store_true' , help = 'If an existing cert covers some subset of the requested names, always expand and replace it with the additional names.' ) #NEWLINE# helpful . add ( 'automation' , '--version' , action = 'version' , version = '%(prog)s {0}' . format ( certbot . __version__ ) , help = "show program's version number and exit" ) #NEWLINE# helpful . add ( 'automation' , '--force-renewal' , '--renew-by-default' , action = 'store_true' , dest = 'renew_by_default' , help = 'If a certificate already exists for the requested domains, renew it now, regardless of whether it is near expiry. (Often --keep-until-expiring is more appropriate). Also implies --expand.' ) #NEWLINE# helpful . add ( 'automation' , '--allow-subset-of-names' , action = 'store_true' , help = 'When performing domain validation, do not consider it a failure if authorizations can not be obtained for a strict subset of the requested domains. This may be useful for allowing renewals for multiple domains to succeed even if some domains no longer point at this system. This option cannot be used with --csr.' ) #NEWLINE# helpful . add ( 'automation' , '--agree-tos' , dest = 'tos' , action = 'store_true' , help = 'Agree to the ACME Subscriber Agreement' ) #NEWLINE# helpful . add ( 'automation' , '--account' , metavar = 'ACCOUNT_ID' , help = 'Account ID to use' ) #NEWLINE# helpful . add ( 'automation' , '--duplicate' , dest = 'duplicate' , action = 'store_true' , help = 'Allow making a certificate lineage that duplicates an existing one (both can be renewed in parallel)' ) #NEWLINE# helpful . add ( 'automation' , '--os-packages-only' , action = 'store_true' , help = '(letsencrypt-auto only) install OS package dependencies and then stop' ) #NEWLINE# helpful . add ( 'automation' , '--no-self-upgrade' , action = 'store_true' , help = '(letsencrypt-auto only) prevent the letsencrypt-auto script from upgrading itself to newer released versions' ) #NEWLINE# helpful . add ( 'automation' , '-q' , '--quiet' , dest = 'quiet' , action = 'store_true' , help = 'Silence all output except errors. Useful for automation via cron. Implies --non-interactive.' ) #NEWLINE# helpful . add_group ( 'testing' , description = "The following flags are meant for testing purposes only! Do NOT change them, unless you really know what you're doing!" ) #NEWLINE# helpful . add ( 'testing' , '--debug' , action = 'store_true' , help = 'Show tracebacks in case of errors, and allow letsencrypt-auto execution on experimental platforms' ) #NEWLINE# helpful . add ( 'testing' , '--no-verify-ssl' , action = 'store_true' , help = config_help ( 'no_verify_ssl' ) , default = flag_default ( 'no_verify_ssl' ) ) #NEWLINE# helpful . add ( 'testing' , '--tls-sni-01-port' , type = int , default = flag_default ( 'tls_sni_01_port' ) , help = config_help ( 'tls_sni_01_port' ) ) #NEWLINE# helpful . add ( 'testing' , '--http-01-port' , type = int , dest = 'http01_port' , default = flag_default ( 'http01_port' ) , help = config_help ( 'http01_port' ) ) #NEWLINE# helpful . add ( 'testing' , '--break-my-certs' , action = 'store_true' , help = 'Be willing to replace or renew valid certs with invalid (testing/staging) certs' ) #NEWLINE# helpful . add_group ( 'security' , description = 'Security parameters & server settings' ) #NEWLINE# helpful . add ( 'security' , '--rsa-key-size' , type = int , metavar = 'N' , default = flag_default ( 'rsa_key_size' ) , help = config_help ( 'rsa_key_size' ) ) #NEWLINE# helpful . add ( 'security' , '--redirect' , action = 'store_true' , help = 'Automatically redirect all HTTP traffic to HTTPS for the newly authenticated vhost.' , dest = 'redirect' , default = None ) #NEWLINE# helpful . add ( 'security' , '--no-redirect' , action = 'store_false' , help = 'Do not automatically redirect all HTTP traffic to HTTPS for the newly authenticated vhost.' , dest = 'redirect' , default = None ) #NEWLINE# helpful . add ( 'security' , '--hsts' , action = 'store_true' , help = 'Add the Strict-Transport-Security header to every HTTP response. Forcing browser to use always use SSL for the domain. Defends against SSL Stripping.' , dest = 'hsts' , default = False ) #NEWLINE# helpful . add ( 'security' , '--no-hsts' , action = 'store_false' , help = 'Do not automatically add the Strict-Transport-Security header to every HTTP response.' , dest = 'hsts' , default = False ) #NEWLINE# helpful . add ( 'security' , '--uir' , action = 'store_true' , help = 'Add the "Content-Security-Policy: upgrade-insecure-requests" header to every HTTP response. Forcing the browser to use https:// for every http:// resource.' , dest = 'uir' , default = None ) #NEWLINE# helpful . add ( 'security' , '--no-uir' , action = 'store_false' , help = ' Do not automatically set the "Content-Security-Policy: upgrade-insecure-requests" header to every HTTP response.' , dest = 'uir' , default = None ) #NEWLINE# helpful . add ( 'security' , '--strict-permissions' , action = 'store_true' , help = 'Require that all configuration files are owned by the current user; only needed if your config is somewhere unsafe like /tmp/' ) #NEWLINE# helpful . add_group ( 'renew' , description = "The 'renew' subcommand will attempt to renew all certificates (or more precisely, certificate lineages) you have previously obtained if they are close to expiry, and print a summary of the results. By default, 'renew' will reuse the options used to create obtain or most recently successfully renew each certificate lineage. You can try it with `--dry-run` first. For more fine-grained control, you can renew individual lineages with the `certonly` subcommand. Hooks are available to run commands  before and after renewal; see XXX for more information on these." ) #NEWLINE# helpful . add ( 'renew' , '--pre-hook' , help = 'Command to be run in a shell before obtaining any certificates. Intended primarily for renewal, where it can be used to temporarily shut down a webserver that might conflict with the standalone plugin. This will  only be called if a certificate is actually to be obtained/renewed. ' ) #NEWLINE# helpful . add ( 'renew' , '--post-hook' , help = 'Command to be run in a shell after attempting to obtain/renew  certificates. Can be used to deploy renewed certificates, or to restart any servers that were stopped by --pre-hook.' ) #NEWLINE# helpful . add ( 'renew' , '--renew-hook' , help = 'Command to be run in a shell once for each successfully renewed certificate.For this command, the shell variable $RENEWED_LINEAGE will point to theconfig live subdirectory containing the new certs and keys; the shell variable $RENEWED_DOMAINS will contain a space-delimited list of renewed cert domains' ) #NEWLINE# helpful . add_deprecated_argument ( '--agree-dev-preview' , 0 ) #NEWLINE# _create_subparsers ( helpful ) #NEWLINE# _paths_parser ( helpful ) #NEWLINE# _plugins_parsing ( helpful , plugins ) #NEWLINE# if ( not detect_defaults ) : #NEWLINE# #INDENT# global helpful_parser #NEWLINE# helpful_parser = detect_defaults #NEWLINE# #UNINDENT# return helpful . parse_args ( )