]> gitweb.fluxo.info Git - keyringer.git/commitdiff
Adding 'find' action
authorSilvio Rhatto <rhatto@riseup.net>
Thu, 26 Dec 2013 23:56:04 +0000 (21:56 -0200)
committerSilvio Rhatto <rhatto@riseup.net>
Thu, 26 Dec 2013 23:56:04 +0000 (21:56 -0200)
ChangeLog
lib/keyringer/actions/find [new file with mode: 0755]
share/man/keyringer.1.mdwn

index 2de87c4329a1ca6aa3e561b0dbd17c4e1df5f1d5..eb6b543a4c60ae68a2915e0810ef21d9678563e1 100644 (file)
--- 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 (executable)
index 0000000..92bec25
--- /dev/null
@@ -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"
index ad9569b462753f7b4ac4232a6b08722cd89f1f9f..c3a8a7ca965d65e6e7d4c19150bc17805a5b2400 100644 (file)
@@ -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.