diff options
| author | Karel Kočí <cynerd@email.cz> | 2018-01-20 22:28:59 +0100 | 
|---|---|---|
| committer | Karel Kočí <cynerd@email.cz> | 2018-01-20 22:28:59 +0100 | 
| commit | 9e424dae63ff66f889b8618c4fa4a6b3bf1b2012 (patch) | |
| tree | bf223bdfa3985435b936a0cd786430c7336d6362 /zsh_completions/usbkey | |
| parent | 7e5fd86cf259a0d5ab98d3ae0081931832f8f760 (diff) | |
| download | myconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.tar.gz myconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.tar.bz2 myconfigs-9e424dae63ff66f889b8618c4fa4a6b3bf1b2012.zip  | |
Move usbkey to separate repo
Diffstat (limited to 'zsh_completions/usbkey')
| -rw-r--r-- | zsh_completions/usbkey | 57 | 
1 files changed, 0 insertions, 57 deletions
diff --git a/zsh_completions/usbkey b/zsh_completions/usbkey deleted file mode 100644 index eada8f6..0000000 --- a/zsh_completions/usbkey +++ /dev/null @@ -1,57 +0,0 @@ -#compdef usbkey -#autoload - -_usbkey_mounted() { -	mount | grep "/media/usbkey" | grep -q "/dev/mapper/usbkey" -} - -_usbkey () { -	local cmd -	if (( CURRENT > 2)); then -		_usbkey_mounted || return -		operation=${words[2]} -		# Run the completion for the subcommand -		case "${operation}" in -			ssh-import) -				[ -d "/media/usbkey/ssh" ] || return -				local keys=() -				for F in $(find "/media/usbkey/ssh" -name '*.pub'); do -					F="${F#/media/usbkey/ssh/}" -					keys+=("${F%.pub}") -				done -				_describe -t keys 'usbkey' keys -				;; -			openvpn-get) -				[ -d "/media/usbkey/openvpn" ] || return -				local certs=() -				for F in $(find "/media/usbkey/openvpn" -name 'ca.crt' -o -name '*.crt' -print); do -					F="${F#/media/usbkey/openvpn/}" -					certs+=("${F%.crt}") -				done -				_describe -t certificates 'usbkey' certs -				;; -			# TODO -		esac -	else -		local operations=( -			"mount:Mount key of usb driver" -			"unmount:Unmount usb driver" -			"sync:Synchronize drive to bakup drive" -		) -		if _usbkey_mounted; then -			operations+=( -				"gpg-import:Import gpg key" -				"ssh-import:Import ssh key" -				"ssh-generate:Generate new ssh key" -				"ssh-list:List all SSH keys in store" -				"openvpn-list:List all OpenVPN keys" -				"openvpn-get:Get OpenVPN keys for some host" -				"openvpn-generate:Generate OpenVPN key for new host" -			) -		fi -		_describe -t operations 'usbkey' operations -		_arguments : "--help[Output help message]" -	fi -} - -_usbkey  | 
