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

1
requirements.txt

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

Loading…
Cancel
Save