diff --git a/pmb/helpers/frontend.py b/pmb/helpers/frontend.py index d786494408595f9e62286c4a87031254dd4d15eb..924741cb56f88821a71d677ef1c13b73be61bfce 100644 --- a/pmb/helpers/frontend.py +++ b/pmb/helpers/frontend.py @@ -363,31 +363,3 @@ def bootimg_analyze(args): for line in pmb.aportgen.device.generate_deviceinfo_fastboot_content(args, bootimg).split("\n"): tmp_output += "\n" + line.lstrip() logging.info(tmp_output) - - -def register_bash_completion(args): - try: - import argcomplete - except ImportError: - raise RuntimeError("Could not find argcomplete! You can install it " - "with 'pip3 install argcomplete'") - dest = os.path.abspath(os.path.expanduser(args.dest)) - command = os.path.basename(sys.argv[0]) - dest_file = os.path.join(dest, command) - if args.uninstall: - logging.info("Removing file {}".format(dest_file)) - os.remove(dest_file) - try: - os.removedirs(dest) - except OSError: - pass - else: - if "shellcode" not in dir(argcomplete): - raise RuntimeError("Argcomplete must be >=1.9.4. You can update " - "with 'pip3 install --upgrade argcomplete'") - logging.info("Writing to {}".format(dest_file)) - os.makedirs(dest, mode=0o755, exist_ok=True) - with open(dest_file, "w") as f: - f.write(argcomplete.shellcode(command)) - logging.info("Success! Please close and re-open your terminal to " - "enable bash completion") diff --git a/pmb/parse/arguments.py b/pmb/parse/arguments.py index aad34d52a5cf178cb9e2a64e2f7a6d22062e1564..98e0aaf6676c137238203c87ba2272c4c0dfe19e 100644 --- a/pmb/parse/arguments.py +++ b/pmb/parse/arguments.py @@ -478,16 +478,6 @@ def arguments(): help="force even if the file seems to be" " invalid") - # Action: register_bash_completion - completion = sub.add_parser("register_bash_completion", - help="install bash completion script") - completion_default_dir = "~/.local/share/bash-completion/completions/" - completion.add_argument("--dest", default=completion_default_dir, - help="destination directory, default: {}".format( - completion_default_dir)) - completion.add_argument("--uninstall", action="store_true", - help="remove bash completion script") - if argcomplete: argcomplete.autocomplete(parser, always_complete_options="long") diff --git a/setup.py b/setup.py index 6d3d5cbb8bc5a818b7b7700f31267ba0c98e4e9f..0db627af0751ab25c03bc8e2e792d3f4bdfdeea8 100644 --- a/setup.py +++ b/setup.py @@ -61,7 +61,7 @@ setup( tests_require=['pytest'], cmdclass={'test': PyTest}, extras_require={ - 'argcomplete': ["argcomplete>=1.9.4"], + 'argcomplete': ["argcomplete"], }, entry_points={ 'console_scripts': [