about summary refs log tree commit diff
path: root/_nq
diff options
context:
space:
mode:
Diffstat (limited to '_nq')
-rw-r--r--_nq27
1 files changed, 27 insertions, 0 deletions
diff --git a/_nq b/_nq
new file mode 100644
index 0000000..27269b9
--- /dev/null
+++ b/_nq
@@ -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 "$@"