added some more stuff and changed prompt

This commit is contained in:
Nikolas Weger 2017-07-24 01:55:33 +02:00
parent cb62f96109
commit ae447242b5
11 changed files with 3181 additions and 1 deletions

61
lib/local/_lj Normal file
View file

@ -0,0 +1,61 @@
#compdef lj
###
# List of log levels
###
_levels=(
'emergency'
'alert'
'critical'
'error'
'warning'
'notice'
'info'
'debug'
)
###
# Describe log levels
###
function _lumberjack_log_levels() {
_describe -t levels 'levels' _levels "$@"
}
###
# Lumberjack completion
###
function _lumberjack() {
typeset -A opt_args
local context state line curcontext="$curcontext"
# Set option arguments
_arguments -A \
'(-h --help)'{-h,--help}'[show help text and exit]' \
'(-v --version)'{-v,--version}'[show version information and exit]' \
'(-f --file)'{-f,--file}'[set log file and exit]' \
'(-l --level)'{-l,--level}'[set log level and exit]' \
# Set log level arguments
_arguments \
'1: :_lumberjack_log_levels' \
'*::arg:->args'
# Complete option arguments
case "$state" in
args )
case "$words[1]" in
--file|-f )
_arguments \
'1:file:_files'
;;
--level|-l )
_arguments \
'1:level:_lumberjack_log_levels'
;;
esac
;;
esac
}
_lumberjack "$@"