Browse Source

completion script

tags/v2.0.0
Robin Thoni 9 years ago
parent
commit
da92988313
1 changed files with 14 additions and 0 deletions
  1. 14
    0
      sitegen.completion

+ 14
- 0
sitegen.completion View File

@@ -0,0 +1,14 @@
1
+#!/usr/bin/env bash
2
+
3
+_sitegen()
4
+{
5
+  cur=${COMP_WORDS[COMP_CWORD]}
6
+  if [ $COMP_CWORD -eq 2 ]
7
+  then
8
+    confs=$(env ls /etc/sitegen/ 2>/dev/null | sed 's/\.[^.]*$//' | sort | uniq | sed 's/^sitegen$//')
9
+    COMPREPLY=($(compgen -W "${confs}" "${cur}"))
10
+  else
11
+    COMPREPLY=()
12
+  fi
13
+}
14
+complete -F _sitegen sitegen

Loading…
Cancel
Save