david-caro / wm-ssh

SSH wrapper that tries to resolve wikimedia hostnames from different sources
GNU General Public License v3.0
0 stars 1 forks source link

--flush-caches requires argument? #1

Closed nskaggs closed 2 years ago

nskaggs commented 2 years ago

$ wm-ssh --help Usage: wm-ssh [OPTIONS] [HOSTNAME] [ARGS]...

Wikimedia ssh wrapper that expands hostnames

Options: -v, --verbose Show extra verbose output --print-config Show the loaded configuration --config-file PATH Path to the configuration file with the wm-ssh settings. --no-caches Ignore the caches, this does not remove them, only ignores them for the run. --flush-caches Clean the caches, this removes any cached hosts. --help Show this message and exit.

$ wm-ssh --flush-caches Error: Missing argument 'HOSTNAME' $ wm-ssh --flush-caches all This will erase the caches permanently, are you sure? [y/N]: y Traceback (most recent call last): File "/home/nskaggs/.local/bin/wm-ssh", line 8, in sys.exit(wm_ssh()) File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in call return self.main(args, kwargs) File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main rv = self.invoke(ctx) File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke return ctx.invoke(self.callback, ctx.params) File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke return __callback(args, **kwargs) File "/home/nskaggs/.local/lib/python3.10/site-packages/wm_ssh/cli.py", line 302, in wm_ssh netbox_cachefile.replace_content("") File "/home/nskaggs/.local/lib/python3.10/site-packages/wm_ssh/cli.py", line 49, in replace_content self.path.write_text(data=new_content) File "/usr/lib/python3.10/pathlib.py", line 1152, in write_text with self.open(mode='w', encoding=encoding, errors=errors, newline=newline) as f: File "/usr/lib/python3.10/pathlib.py", line 1117, in open return self._accessor.open(self, mode, buffering, encoding, errors, FileNotFoundError: [Errno 2] No such file or directory: '/home/nskaggs/.cache/wm-ssh/netbox.txt'

david-caro commented 2 years ago

Yep, it's not implemented as a subcommand, but that has to change :+1: