aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2013-12-26 21:56:04 -0200
committerSilvio Rhatto <rhatto@riseup.net>2013-12-26 21:56:04 -0200
commitb95155761a1789557ea1569491d149e3c90d295b (patch)
tree3a3df3c48d7baa3fcd57ab5433a75dcb34eab4fa
parent4a19a5a2db0e49846249bf4b7ce02a2c6e143626 (diff)
downloadkeyringer-b95155761a1789557ea1569491d149e3c90d295b.tar.gz
keyringer-b95155761a1789557ea1569491d149e3c90d295b.tar.bz2
Adding 'find' action
-rw-r--r--ChangeLog4
-rwxr-xr-xlib/keyringer/actions/find19
-rw-r--r--share/man/keyringer.1.mdwn3
3 files changed, 26 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 2de87c4..eb6b543 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2013-12-26 - Silvio Rhatto <rhatto@riseup.net>
+
+ New action: find.
+
2013-12-10 - Silvio Rhatto <rhatto@riseup.net>
New actions: shell (#34), help, mkdir, teardown.
diff --git a/lib/keyringer/actions/find b/lib/keyringer/actions/find
new file mode 100755
index 0000000..92bec25
--- /dev/null
+++ b/lib/keyringer/actions/find
@@ -0,0 +1,19 @@
+#!/bin/bash
+#
+# Find secrets.
+#
+
+# Load functions
+LIB="`dirname $0`/../functions"
+source "$LIB" || exit 1
+
+# Aditional parameters
+CWD="`pwd`"
+
+# Avoid leading slash
+shift
+ARGS="`echo "$*" | sed -e "s|^/*||"`"
+
+# Run find command
+cd "$KEYDIR/$RELATIVE_PATH" && find -iname "*$ARGS*"
+cd "$CWD"
diff --git a/share/man/keyringer.1.mdwn b/share/man/keyringer.1.mdwn
index ad9569b..c3a8a7c 100644
--- a/share/man/keyringer.1.mdwn
+++ b/share/man/keyringer.1.mdwn
@@ -37,6 +37,9 @@ Keyringer has three types of actions:
# REPOSITORY LOOKUP AND MANIPULATION ACTIONS
+find <*expression*>
+: Find secrets in the repository.
+
init <*path*> [*remote*]
: Initialize a new keyringer repository. If a *remote* URL is specified, keyringer will
clone an existing repository.