diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-10-03 07:44:23 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2012-10-03 07:44:23 +0200 |
commit | 94d9b4390f7b0a01b6aa6ad91439570b7cbef967 (patch) | |
tree | 67a0fc5342e7a57e3b2c18e9f1e0e841701bd6c4 | |
parent | 8681d2000b756955f6f1a25601e0c3128691cb5c (diff) | |
download | pass-94d9b4390f7b0a01b6aa6ad91439570b7cbef967.tar.gz pass-94d9b4390f7b0a01b6aa6ad91439570b7cbef967.tar.bz2 pass-94d9b4390f7b0a01b6aa6ad91439570b7cbef967.zip |
Make --no-echo default, and rename to --echo.
Reported-by: Paul Wise <pabs@debian.org>
Diffstat (limited to '')
-rw-r--r-- | man/pass.1 | 4 | ||||
-rwxr-xr-x | src/password-store.sh | 16 |
2 files changed, 10 insertions, 10 deletions
@@ -75,9 +75,9 @@ clipboard using .BR xclip (1) and then restore the clipboard after 45 seconds. .TP -\fBinsert\fP [ \fI--no-echo\fP, \fI-n\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP +\fBinsert\fP [ \fI--echo\fP, \fI-e\fP | \fI--multiline\fP, \fI-m\fP ] [ \fI--force\fP, \fI-f\fP ] \fIpass-name\fP Insert a new password into the password store called \fIpass-name\fP. This will -read the new password from standard in. If \fI--no-echo\fP or \fI-n\fP is specified, do +read the new password from standard in. If \fI--echo\fP or \fI-e\fP is \fInot\fPspecified, disable keyboard echo when the password is entered and confirm the password by asking for it twice. If \fI--multiline\fP or \fI-m\fP is specified, lines will be read until EOF or Ctrl+D is reached. Otherwise, only a single line from standard in is read. Prompt diff --git a/src/password-store.sh b/src/password-store.sh index 4a04fbe..8afc67e 100755 --- a/src/password-store.sh +++ b/src/password-store.sh @@ -38,9 +38,9 @@ Usage: $program [show] [--clip,-c] pass-name Show existing password and optionally put it on the clipboard. If put on the clipboard, it will be cleared in 45 seconds. - $program insert [--no-echo,-n | --multiline,-m] [--force,-f] pass-name - Insert new password. Optionally, the console can be enabled to not - echo the password back. Or, optionally, it may be multiline. Prompt + $program insert [--echo,-e | --multiline,-m] [--force,-f] pass-name + Insert new password. Optionally, the console can be enabled echo + the password back. Or, optionally, it may be multiline. Prompt before overwriting existing password unless forced. $program edit pass-name Insert a new password or edit an existing password using ${EDITOR:-vi}. @@ -231,21 +231,21 @@ case "$command" in ;; insert) multiline=0 - noecho=0 + noecho=1 force=0 - opts="$($GETOPT -o mnf -l multiline,no-echo,force -n "$program" -- "$@")" + opts="$($GETOPT -o mef -l multiline,echo,force -n "$program" -- "$@")" err=$? eval set -- "$opts" while true; do case $1 in -m|--multiline) multiline=1; shift ;; - -n|--no-echo) noecho=1; shift ;; + -e|--echo) noecho=0; shift ;; -f|--force) force=1; shift ;; --) shift; break ;; esac done - if [[ $err -ne 0 || ( $multiline -eq 1 && $noecho -eq 1 ) || $# -ne 1 ]]; then - echo "Usage: $program $command [--no-echo,-n | --multiline,-m] [--force,-f] pass-name" + if [[ $err -ne 0 || $# -ne 1 ]]; then + echo "Usage: $program $command [--echo,-e | --multiline,-m] [--force,-f] pass-name" exit 1 fi path="$1" |