Browse Source

Add CLI autocompletion using argcomplete

pull/47/head
Benjamin Renard 4 months ago committed by R4SAS
parent
commit
b40f48295a
  1. 6
      pbincli/cli.py
  2. 1
      requirements.txt

6
pbincli/cli.py

@ -1,7 +1,10 @@ @@ -1,7 +1,10 @@
#!/usr/bin/env python
# PYTHON_ARGCOMPLETE_OK
import os, sys, argparse
from distutils.util import strtobool
import argcomplete
import pbincli.actions
from pbincli.api import PrivateBin
from pbincli.utils import PBinCLIException, PBinCLIError, validate_url_ending
@ -124,6 +127,9 @@ def main(): @@ -124,6 +127,9 @@ def main():
delete_parser.add_argument("-d", "--debug", default=False, action="store_true", help="Enable debug output")
delete_parser.set_defaults(func=pbincli.actions.delete)
# Add argcomplete trigger
argcomplete.autocomplete(parser)
# parse arguments
args = parser.parse_args()

1
requirements.txt

@ -2,3 +2,4 @@ pycryptodome @@ -2,3 +2,4 @@ pycryptodome
sjcl
base58
requests
argcomplete

Loading…
Cancel
Save