From ee215d2ebba0cb24844d907ab45710d0584e3127 Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Thu, 27 Oct 2022 15:20:20 +0200 Subject: [PATCH] Call it 'completion'. like all the cool kids --- README.md | 14 +++++++------- scripts/knotctl | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 1a61994..b8c91bc 100644 --- a/README.md +++ b/README.md @@ -20,11 +20,11 @@ A prebuilt deb-package is also available from the release page: https://code.smo ## Shell completion For bash: add this to .bashrc ``` -source <(knotctl complete) +source <(knotctl completion) ``` For fish, run: ``` -knotctl complete --shell fish > ~/.config/fish/completions/knotctl.fish +knotctl completion --shell fish > ~/.config/fish/completions/knotctl.fish ``` For tcsh: add this to .cshrc ``` @@ -34,15 +34,15 @@ For zsh: add this to .zshrc ``` autoload -U bashcompinit bashcompinit -source <(knotctl complete) +source <(knotctl completion) ``` ## Usage ``` usage: knotctl [-h] [--json | --no-json] - {add,complete,config,delete,list,update} ... + {add,completion,config,delete,list,update} ... positional arguments: - {add,complete,config,delete,list,update} + {add,completion,config,delete,list,update} options: -h, --help show this help message and exit @@ -60,9 +60,9 @@ options: -t TTL, --ttl TTL -z ZONE, --zone ZONE ``` -### COMPLETE +### COMPLETION ``` -usage: knotctl complete [-h] [-s SHELL] +usage: knotctl completion [-h] [-s SHELL] options: -h, --help show this help message and exit diff --git a/scripts/knotctl b/scripts/knotctl index da0b84c..8581bb7 100755 --- a/scripts/knotctl +++ b/scripts/knotctl @@ -177,7 +177,7 @@ def main() -> int: addcmd.add_argument("-t", "--ttl", required=True) addcmd.add_argument("-z", "--zone", required=True) - completecmd = subparsers.add_parser("complete") + completecmd = subparsers.add_parser("completion") completecmd.add_argument("-s", "--shell") configcmd = subparsers.add_parser("config") @@ -206,7 +206,7 @@ def main() -> int: argcomplete.autocomplete(parser) args = parser.parse_args() - if args.command == "complete": + if args.command == "completion": run_complete(args.shell) return 0