()
| 22 | |
| 23 | |
| 24 | def main(): |
| 25 | parser = argparse.ArgumentParser() |
| 26 | |
| 27 | # using if statements here for indentation to help organise subcommands/arguments |
| 28 | if command := parser.add_subparsers(dest="command"): |
| 29 | if encrypt := command.add_parser("e", help="Encrypt content"): |
| 30 | encrypt.add_argument("content", nargs="?") |
| 31 | if decrypt := command.add_parser("d", help="Decrypt content"): |
| 32 | decrypt.add_argument("content", nargs="?") |
| 33 | |
| 34 | command.add_parser("keygen", help="Generate a key. You could set this to $FERNET_KEY if you want") |
| 35 | command.add_parser("vercel", help="Output the vercel auth data.") |
| 36 | command.add_parser("addmask", help="Mask all secrets.") |
| 37 | |
| 38 | cmd(parser.parse_args(namespace=Args())) |
| 39 | |
| 40 | |
| 41 | def cmd(args: Args): |
no test coverage detected