summaryrefslogtreecommitdiff
path: root/lib/keyringer/actions/options
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-11-14 18:39:49 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-11-14 18:39:49 -0200
commitf978a7fcc7917df39a64800838e814927971469e (patch)
treef896cbdf16d66610b9eb070d9e640090f3e9a2cc /lib/keyringer/actions/options
parent1b1197728cfd029deb46ebbe6ac0a70bcee58510 (diff)
parent9cd7165a5a63a5824a327920b428eeed8aec528e (diff)
downloadkeyringer-upstream_keyringer_0.2.7.tar.gz
keyringer-upstream_keyringer_0.2.7.tar.bz2
Imported Upstream version 0.2.7upstream_keyringer_0.2.7
Diffstat (limited to 'lib/keyringer/actions/options')
-rwxr-xr-xlib/keyringer/actions/options30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/keyringer/actions/options b/lib/keyringer/actions/options
new file mode 100755
index 0000000..8508aea
--- /dev/null
+++ b/lib/keyringer/actions/options
@@ -0,0 +1,30 @@
+#!/bin/bash
+#
+# Recipient management.
+#
+
+# Load functions
+LIB="`dirname $0`/../functions"
+source "$LIB" || exit 1
+
+# Command parser
+keyringer_get_command "$2"
+
+# Create options file if old repository
+if [ ! -e "$OPTIONS" ]; then
+ echo "Creating options file..."
+ touch "$OPTIONS"
+ keyringer_exec git "$BASEDIR" add config/options
+fi
+
+if [ "$COMMAND" == "ls" ]; then
+ cat "$OPTIONS"
+elif [ "$COMMAND" == "edit" ]; then
+ "$EDITOR" "$OPTIONS"
+elif [ "$COMMAND" == "add" ]; then
+ shift 2
+ echo $* >> "$OPTIONS"
+else
+ printf "%s: No such command %s\n" "$BASENAME" "$COMMAND"
+ exit 1
+fi