]> gitweb.fluxo.info Git - keyringer.git/commitdiff
adding new commands append-batch and encrypt-batch, which reduce
authorJamie McClelland <jm@mayfirst.org>
Sun, 19 Sep 2010 16:44:11 +0000 (12:44 -0400)
committerJamie McClelland <jm@mayfirst.org>
Sun, 19 Sep 2010 16:44:11 +0000 (12:44 -0400)
the verbosity of the messages being displayed.

share/keyringer/append
share/keyringer/append-batch [new symlink]
share/keyringer/encrypt
share/keyringer/encrypt-batch [new symlink]

index 436b1ca38a4e24c5e1bd2f491f6cd1cb3a915bfe..81300e0e35ba6396cd1237a9f94fc847cf6d9226 100755 (executable)
@@ -15,10 +15,13 @@ IFS=$'\n'
 
 CONTENT=($(keyringer_exec decrypt $BASEDIR $FILE))
 
-echo " "
-echo "$FILE currently has ${#CONTENT[@]} lines"
-echo " "
-echo "Now please write the content to be appended on $FILE, finnishing with Ctrl-D:"
+if [ "$1" = "append" ]; then
+  # only display directions if we're running append, not append-batch
+  echo " "
+  echo "$FILE currently has ${#CONTENT[@]} lines"
+  echo " "
+  echo "Now please write the content to be appended on $FILE, finnishing with Ctrl-D:"
+fi
 
 APPEND=($(cat -))
 
@@ -26,6 +29,6 @@ NEW=( ${CONTENT[@]} ${APPEND[@]} )
 
 for element in $(seq 0 $((${#NEW[@]} - 1))); do
   echo ${NEW[$element]}
-done | keyringer_exec encrypt $BASEDIR $FILE
+done | keyringer_exec encrypt-batch $BASEDIR $FILE
 
 IFS="$OLDIFS"
diff --git a/share/keyringer/append-batch b/share/keyringer/append-batch
new file mode 120000 (symlink)
index 0000000..6b140f7
--- /dev/null
@@ -0,0 +1 @@
+append
\ No newline at end of file
index ac2a43ee4c4f812fbc6971e8d737a039fa40044e..14ee7073834cd333d65ffaf33de8459587d2fa1e 100755 (executable)
@@ -12,7 +12,12 @@ keyringer_get_new_file $2
 
 # Encrypt
 mkdir -p $KEYDIR/`dirname $FILE`
-echo "Type your message and finish your input with EOF (Ctrl-D)."
+
+if [ "$1" = "encrypt" ]; then
+  # only display directions if we're running encrypt, not encrypt-batch
+  echo "Type your message and finish your input with EOF (Ctrl-D)."
+fi
+
 gpg --use-agent --armor -e -s $(keyringer_recipients $RECIPIENTS) - > $KEYDIR/$FILE
 
 # Stage
diff --git a/share/keyringer/encrypt-batch b/share/keyringer/encrypt-batch
new file mode 120000 (symlink)
index 0000000..8267197
--- /dev/null
@@ -0,0 +1 @@
+encrypt
\ No newline at end of file