[PATCH 4/6] Add the new option to `getopt`'s invocations.

Doron Behar doron.behar at gmail.com
Wed Feb 7 20:39:36 CET 2018


---
 src/password-store.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/password-store.sh b/src/password-store.sh
index 0141599..2d7a40e 100755
--- a/src/password-store.sh
+++ b/src/password-store.sh
@@ -366,12 +366,13 @@ cmd_init() {
 
 cmd_show() {
 	local opts selected_line clip=0 qrcode=0
-	opts="$($GETOPT -o q::c:: -l qrcode::,clip:: -n "$PROGRAM" -- "$@")"
+	opts="$($GETOPT -o q::c::C:: -l qrcode::,clip::,next-clip:: -n "$PROGRAM" -- "$@")"
 	local err=$?
 	eval set -- "$opts"
 	while true; do case $1 in
 		-q|--qrcode) qrcode=1; selected_line="${2:-1}"; shift 2 ;;
 		-c|--clip) clip=1; selected_line="${2:-1}"; shift 2 ;;
+		-C|--next-clip) nextclip=1; selected_line="${2:-1}"; shift ;;
 		--) shift; break ;;
 	esac done
 
@@ -509,13 +510,14 @@ cmd_edit() {
 
 cmd_generate() {
 	local opts qrcode=0 clip=0 nextclip=0 force=0 characters="$CHARACTER_SET" inplace=0 pass
-	opts="$($GETOPT -o nqcif -l no-symbols,qrcode,clip,in-place,force -n "$PROGRAM" -- "$@")"
+	opts="$($GETOPT -o nqcCif -l no-symbols,qrcode,clip,next-clip,in-place,force -n "$PROGRAM" -- "$@")"
 	local err=$?
 	eval set -- "$opts"
 	while true; do case $1 in
 		-n|--no-symbols) characters="$CHARACTER_SET_NO_SYMBOLS"; shift ;;
 		-q|--qrcode) qrcode=1; shift ;;
 		-c|--clip) clip=1; shift ;;
+		-C|--next-clip) nextclip=1; shift ;;
 		-f|--force) force=1; shift ;;
 		-i|--in-place) inplace=1; shift ;;
 		--) shift; break ;;
-- 
2.16.1




More information about the Password-Store mailing list