From 33129ea7ec60d5c4056a94ff5202605d0c953ab6 Mon Sep 17 00:00:00 2001 From: xgaia Date: Tue, 11 Jun 2024 22:09:54 +0200 Subject: [PATCH] feat: add a --local-only option to use only local cheats --- arsenal/app.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arsenal/app.py b/arsenal/app.py index 65a37c3..bffc133 100644 --- a/arsenal/app.py +++ b/arsenal/app.py @@ -49,6 +49,7 @@ def get_args(self): group_out.add_argument('-t', '--tmux', action='store_true', help='Send command to tmux panel') group_out.add_argument('-c', '--check', action='store_true', help='Check the existing commands') group_out.add_argument('-f', '--prefix', action='store_true', help='command prefix') + group_out.add_argument('-l', '--local-only', action='store_true', help='Local cheats only') parser.add_argument('-V', '--version', action='version', version='%(prog)s (version {})'.format(__version__)) return parser.parse_args() @@ -56,6 +57,10 @@ def get_args(self): def run(self): args = self.get_args() + # keep only ~/.cheats if --local-only is set + if args.local_only: + config.CHEATS_PATHS = [os.path.join(config.HOMEPATH, ".cheats")] + # load cheatsheets cheatsheets = cheat.Cheats().read_files(config.CHEATS_PATHS, config.FORMATS, config.EXCLUDE_LIST)