(helpful: "helpful.HelpfulArgumentParser")
| 12 | |
| 13 | |
| 14 | def _paths_parser(helpful: "helpful.HelpfulArgumentParser") -> None: |
| 15 | add = helpful.add |
| 16 | verb: Union[str, bool] = helpful.verb |
| 17 | if verb == "help": |
| 18 | verb = helpful.help_arg |
| 19 | |
| 20 | cpkwargs = { |
| 21 | "type": os.path.abspath, |
| 22 | "help": "Path to where certificate is saved (with certonly --csr), installed " |
| 23 | "from, or revoked" |
| 24 | } |
| 25 | if verb == "certonly": |
| 26 | cpkwargs["default"] = flag_default("auth_cert_path") |
| 27 | add(["paths", "install", "revoke", "certonly", "manage"], "--cert-path", **cpkwargs) |
| 28 | |
| 29 | section = "paths" |
| 30 | if isinstance(verb, str) and verb in ("install", "revoke"): |
| 31 | section = verb |
| 32 | add(section, "--key-path", type=os.path.abspath, |
| 33 | help="Path to private key for certificate installation " |
| 34 | "or revocation (if account key is missing)") |
| 35 | |
| 36 | default_cp = None |
| 37 | if verb == "certonly": |
| 38 | default_cp = flag_default("auth_chain_path") |
| 39 | add(["paths", "install"], "--fullchain-path", default=default_cp, type=os.path.abspath, |
| 40 | help="Accompanying path to a full certificate chain (certificate plus chain).") |
| 41 | add(["paths", "install"], "--chain-path", default=default_cp, type=os.path.abspath, |
| 42 | help="Accompanying path to a certificate chain.") |
| 43 | add("paths", "--config-dir", default=flag_default("config_dir"), |
| 44 | help=config_help("config_dir")) |
| 45 | add("paths", "--work-dir", default=flag_default("work_dir"), |
| 46 | help=config_help("work_dir")) |
| 47 | add("paths", "--logs-dir", default=flag_default("logs_dir"), |
| 48 | help="Logs directory.") |
| 49 | add(["paths", "show_account"], "--server", default=flag_default("server"), |
| 50 | help=config_help("server")) |
no test coverage detected