Skip to content

Commit

Permalink
Add CLI autocompletion using argcomplete
Browse files Browse the repository at this point in the history
  • Loading branch information
brenard authored and r4sas committed Jul 25, 2024
1 parent 3f30828 commit b40f482
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pbincli/cli.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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()

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pycryptodome
sjcl
base58
requests
argcomplete

0 comments on commit b40f482

Please sign in to comment.