From 38cd373ca34641e3de28a27dca4c97a582ee7200 Mon Sep 17 00:00:00 2001 From: exploide Date: Sun, 14 Mar 2021 20:00:09 +0100 Subject: [PATCH] added completions for mkpasswd --- share/completions/mkpasswd.fish | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 share/completions/mkpasswd.fish diff --git a/share/completions/mkpasswd.fish b/share/completions/mkpasswd.fish new file mode 100644 index 000000000..a86f97ac1 --- /dev/null +++ b/share/completions/mkpasswd.fish @@ -0,0 +1,12 @@ +function __fish_mkpasswd_methods --description "Complete hashing methods for mkpasswd" + mkpasswd -m help | tail -n +2 | string replace -r '^(\S+)\s+(\S.*)' '$1\t$2' + echo -e "help\tList available methods" +end + +complete -c mkpasswd -f +complete -c mkpasswd -s S -l salt -x -d 'Use given string as salt' +complete -c mkpasswd -s R -l rounds -x -d 'Use given number of rounds' +complete -c mkpasswd -s m -l method -xa "(__fish_mkpasswd_methods)" -d 'Compute the password using the given method' +complete -c mkpasswd -s 5 -d 'Like --method=md5crypt' +complete -c mkpasswd -s P -l password-fd -x -d 'Read the password from the given file descriptor' +complete -c mkpasswd -s s -l stdin -d 'Read the password from stdin'