summary refs log tree commit diff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-08-18 13:32:41 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-08-18 13:32:41 +0200
commit4eb2c736f048fbecd1e6ef6865ec8447bfed9c73 (patch)
tree808494a8b0064c6d240601b84ab112b7bd06bb8b
parent6c1da49ae4ec33228262366d6d0437a5d38555e0 (diff)
downloadnq-4eb2c736f048fbecd1e6ef6865ec8447bfed9c73.tar.gz
nq-4eb2c736f048fbecd1e6ef6865ec8447bfed9c73.tar.xz
nq-4eb2c736f048fbecd1e6ef6865ec8447bfed9c73.zip
add zsh completion
-rw-r--r--_fq27
1 files changed, 27 insertions, 0 deletions
diff --git a/_fq b/_fq
new file mode 100644
index 0000000..27269b9
--- /dev/null
+++ b/_fq
@@ -0,0 +1,27 @@
+#compdef nq tq fq
+
+_nq_job() {
+	compadd "$@" -- ${NQDIR:-.}/,*.*(:t)
+}
+
+_nq() {
+	case "$service" in
+	fq)	_arguments -s -A : \
+			'-q[show only one line per job]' \
+			'-a[output for all jobs]' \
+			'*::job:_nq_job'
+		;;
+	nq)	_arguments -A : \
+			'-w[wait for jobs]:*:job:_nq_job' \
+			'-t[check jobs]:*:job:_nq_job' \
+			'(-):command name: _command_names -e' \
+			'*::arguments:_normal'
+		;;
+	tq)	_arguments : \
+			'(-):command name: _command_names -e' \
+			'*::arguments:_normal'
+		;;
+	esac
+}
+
+_nq "$@"