Commits

Arjan Scherpenisse committed 38416df

Commandline tweaks

- hgignore
- zotonic commandline completion

Put this in your .bashrc:

source $PATH_TO_ZOTONIC/src/scripts/helpers/zotonic_completion

  • Participants
  • Parent commits 421ce27

Comments (0)

Files changed (2)

 src/erlydtl/erlydtl_parser.erl
 src/tests/erlydtl/rendered_output/*
 priv/log/*
+priv/sasl/*
 priv/sites/default/files/*
 priv/sites/*/config
 priv/config
+priv/erlang.config
+priv/modules/*
 *.orig
 zotonic.tmproj
 .DS_Store

src/scripts/helpers/zotonic_completion

+#
+# Command-line completion for zotonic
+# ----------------------------------------
+# Copyright 2011 Arjan Scherpenisse
+#
+
+_complete_zotonic() 
+{
+    local cur prev opts
+    COMPREPLY=()
+    cur="${COMP_WORDS[COMP_CWORD]}"
+    prev="${COMP_WORDS[COMP_CWORD-1]}"
+
+    if [ "${cur:0:1}" = "-" ]; then
+        COMPREPLY=( $(compgen -W "--help --version" -- ${cur}) )
+        return 0
+    fi
+    if [ "$prev" == "zotonic" ]; then
+        CMDS=`zotonic 2>&1|head -n 4|tail -n 1`
+        COMPREPLY=( $(compgen -W "$CMDS" -- ${cur}) )
+        return 0
+    fi
+
+}
+complete -F _complete_zotonic zotonic