From 189f4ca3c348ab3609fd7ee5efadeab97b91b907 Mon Sep 17 00:00:00 2001 From: Shun Sakai Date: Fri, 17 Feb 2023 20:39:03 +0900 Subject: [PATCH] Add completions for `scrypt` --- CHANGELOG.rst | 1 + share/completions/scrypt.fish | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 share/completions/scrypt.fish diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 20c003c34..1beab6a06 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -48,6 +48,7 @@ Completions - ``stow`` - ``trash`` and helper utilities ``trash-empty``, ``trash-list``, ``trash-put``, ``trash-restore`` - ``apkanalyzer`` + - ``scrypt`` - git's completion for ``git-foo``-style commands was fixed (:issue:`9457`) - File completion now offers ``../`` and ``./`` again (:issue:`9477`) diff --git a/share/completions/scrypt.fish b/share/completions/scrypt.fish new file mode 100644 index 000000000..8006a24d0 --- /dev/null +++ b/share/completions/scrypt.fish @@ -0,0 +1,23 @@ +# Completions for the scrypt encryption utility + +complete -x -c scrypt -n __fish_use_subcommand -a enc -d "Encrypt file" +complete -x -c scrypt -n __fish_use_subcommand -a dec -d "Decrypt file" +complete -x -c scrypt -n __fish_use_subcommand -a info -d "Print information about the encryption parameters" + +complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s f -d "Force the operation to proceed" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -l logN -a "(seq 10 40)" -d "Set the work parameter N" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s M -d "Use at most the specified bytes of RAM" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s m -d "Use at most the specified fraction of the available RAM" +complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s P -d "Deprecated synonym for `--passphrase dev:stdin-once`" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s p -a "(seq 1 32)" -d "Set the work parameter p" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -l passphrase -a " + dev:tty-stdin\t'Read from /dev/tty, or stdin if fails (default)' + dev:stdin-once\t'Read from stdin' + dev:tty-once\t'Read from /dev/tty' + env:(set -xn)\t'Read from the environment variable' + file:(__fish_complete_path)\t'Read from the file' + " -d "Read the passphrase using the specified method" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s r -a "(seq 1 32)" -d "Set the work parameter r" +complete -x -c scrypt -n "__fish_seen_subcommand_from enc dec" -s t -d "Use at most the specified seconds of CPU time" +complete -c scrypt -n "__fish_seen_subcommand_from enc dec" -s v -d "Print encryption parameters and memory/CPU limits" +complete -x -c scrypt -n "not __fish_seen_subcommand_from enc dec info" -l version -d "Print version"