spm

Personal fork of spm (simple password manager)

commit 296a9b09e978074fd073ca3b9b76a957c1b9c238
parent 3ecae8ad4f6c551ae63c84005cf0b7f97f1ceb36
Author: Sören Tempel <soeren+git@soeren-tempel.net>
Date: Wed, 18 Feb 2015 17:49:19 +0100

Indent code with spaces
3 files changed, 24 insertions(+), 17 deletions(-)
M
contrib/bash_completion
|
30
++++++++++++++++--------------
M
contrib/zsh_completion
|
9
++++++---
M
tpm
|
2
++
diff --git a/contrib/bash_completion b/contrib/bash_completion
@@ -14,25 +14,27 @@
 # along with this program. If not, see <http://www.gnu.org/licenses/>.
 
 _tpm() {
-	local cur="${COMP_WORDS[COMP_CWORD]}"
-	local cmd="${COMP_WORDS[1]}"
+  local cur="${COMP_WORDS[COMP_CWORD]}"
+  local cmd="${COMP_WORDS[1]}"
 
-	if [[ "${cmd}" = "insert" ]]; then
-		_tpm_complete_entries
-	elif [[ "${cmd}" = "show" ]]; then
-		_tpm_complete_entries -type f
-	else
-		COMPREPLY=($(compgen -W "insert show" -- ${cur}))
-	fi
+  if [[ "${cmd}" = "insert" ]]; then
+    _tpm_complete_entries
+  elif [[ "${cmd}" = "show" ]]; then
+    _tpm_complete_entries -type f
+  else
+    COMPREPLY=($(compgen -W "insert show" -- ${cur}))
+  fi
 }
 
 _tpm_complete_entries() {
-	local dir="${TPM_STORE_DIR:-${HOME}/.password-store}"
+  local dir="${TPM_STORE_DIR:-${HOME}/.password-store}"
 
-	if [[ -d "${dir}" ]]; then
-		local files="$(find -L "${dir}/" -name '.git' -prune -o $@ -print | sed -e "s|${dir}.||" -e "s|\.gpg||" | sort)"
-		COMPREPLY=($(compgen -W "${files}" -- ${cur}))
-	fi
+  if [[ -d "${dir}" ]]; then
+    local files="$(find -L "${dir}/" -name '.git' -prune -o $@ -print | sed -e "s|${dir}.||" -e "s|\.gpg||" | sort)"
+    COMPREPLY=($(compgen -W "${files}" -- ${cur}))
+  fi
 }
 
 complete -F _tpm tpm
+
+# vim: et:sw=2:sts=2
diff --git a/contrib/zsh_completion b/contrib/zsh_completion
@@ -23,8 +23,8 @@ _tpm() {
   else
     local -a subcommands
     subcommands=(
-      "show:Show a password for a specified entry"
-      "insert:Insert a new password entry"
+    "show:Show a password for a specified entry"
+    "insert:Insert a new password entry"
     )
 
     _describe -t commands "tpm" subcommands

@@ -35,6 +35,9 @@ _tpm_complete_entries() {
   local dir="${TPM_STORE_DIR:-${HOME}/.password-store}"
 
   if [[ -d "${dir}" ]]; then
-	_values -C 'entries' $(find -L "${dir}/" -name '.git' -prune -o $@ -print | sed -e "s|${dir}.||" -e "s|\.gpg||" | sort)
+    _values -C 'entries' \
+      $(find -L "${dir}/" -name '.git' -prune -o $@ -print | sed -e "s|${dir}.||" -e "s|\.gpg||" | sort)
   fi
 }
+
+# vim: et:sw=2:sts=2
diff --git a/tpm b/tpm
@@ -93,3 +93,5 @@ case "${1}" in
   "insert") insert "${2}" ;;
   *) abort "USAGE: tpm [COMMAND] [ENTRY]" ;;
 esac
+
+# vim: et:sw=2:sts=2