(helpful: "helpful.HelpfulArgumentParser")
| 14 | |
| 15 | |
| 16 | def _create_subparsers(helpful: "helpful.HelpfulArgumentParser") -> None: |
| 17 | from certbot._internal.client import sample_user_agent # avoid import loops |
| 18 | helpful.add( |
| 19 | None, "--user-agent", default=flag_default("user_agent"), |
| 20 | help='Set a custom user agent string for the client. User agent strings allow ' |
| 21 | 'the CA to collect high level statistics about success rates by OS, ' |
| 22 | 'plugin and use case, and to know when to deprecate support for past Python ' |
| 23 | "versions and flags. If you wish to hide this information from the Let's " |
| 24 | 'Encrypt server, set this to "". ' |
| 25 | '(default: {0}). The flags encoded in the user agent are: ' |
| 26 | '--duplicate, --force-renew, --allow-subset-of-names, -n, and ' |
| 27 | 'whether any hooks are set.'.format(sample_user_agent())) |
| 28 | helpful.add( |
| 29 | None, "--user-agent-comment", default=flag_default("user_agent_comment"), |
| 30 | type=_user_agent_comment_type, |
| 31 | help="Add a comment to the default user agent string. May be used when repackaging Certbot " |
| 32 | "or calling it from another tool to allow additional statistical data to be collected." |
| 33 | " Ignored if --user-agent is set. (Example: Foo-Wrapper/1.0)") |
| 34 | helpful.add("certonly", |
| 35 | "--csr", default=flag_default("csr"), type=read_file, |
| 36 | help="Path to a Certificate Signing Request (CSR) in DER or PEM format." |
| 37 | " Currently --csr only works with the 'certonly' subcommand.") |
| 38 | helpful.add("revoke", |
| 39 | "--reason", dest="reason", |
| 40 | choices=CaseInsensitiveList(constants.REVOCATION_REASONS.keys()), |
| 41 | action=_EncodeReasonAction, default=flag_default("reason"), |
| 42 | help="Specify reason for revoking certificate. (default: unspecified)") |
| 43 | helpful.add("revoke", |
| 44 | "--delete-after-revoke", action="store_true", |
| 45 | default=flag_default("delete_after_revoke"), |
| 46 | help="Delete certificates after revoking them, along with all previous and later " |
| 47 | "versions of those certificates. (default: Ask)") |
| 48 | helpful.add("revoke", |
| 49 | "--no-delete-after-revoke", action="store_false", |
| 50 | dest="delete_after_revoke", |
| 51 | default=flag_default("delete_after_revoke"), |
| 52 | help="Do not delete certificates after revoking them. This " |
| 53 | "option should be used with caution because the 'renew' " |
| 54 | "subcommand will attempt to renew undeleted revoked " |
| 55 | "certificates. (default: Ask)") |
| 56 | helpful.add("rollback", |
| 57 | "--checkpoints", type=int, metavar="N", |
| 58 | default=flag_default("rollback_checkpoints"), |
| 59 | help="Revert configuration N number of checkpoints.") |
| 60 | helpful.add("plugins", |
| 61 | "--init", action="store_true", default=flag_default("init"), |
| 62 | help="Initialize plugins.") |
| 63 | helpful.add("plugins", |
| 64 | "--prepare", action="store_true", default=flag_default("prepare"), |
| 65 | help="Initialize and prepare plugins.") |
| 66 | helpful.add("plugins", |
| 67 | "--authenticators", action="append_const", dest="ifaces", |
| 68 | default=flag_default("ifaces"), |
| 69 | const=interfaces.Authenticator, help="Limit to authenticator plugins only.") |
| 70 | helpful.add("plugins", |
| 71 | "--installers", action="append_const", dest="ifaces", |
| 72 | default=flag_default("ifaces"), |
| 73 | const=interfaces.Installer, help="Limit to installer plugins only.") |
no test coverage detected