Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
eepm
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
eepm
Commits
a2ec778a
Commit
a2ec778a
authored
Feb 14, 2013
by
Vitaly Lipatov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add bash competion for cerv
parent
4a8bda41
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
41 additions
and
0 deletions
+41
-0
cerv
bash_completion/cerv
+41
-0
No files found.
bash_completion/cerv
0 → 100644
View file @
a2ec778a
# cerv(8) completion
# This completes on a list of all available services for the
# 'cerv' command, followed by that script's available commands
#
_service_list()
{
COMPREPLY=( $( cerv list-all 2>/dev/null ; echo "list list-all list-startup" ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
_service_usage_list()
{
local USLIST=$(cerv ${prev##*/} usage 2>/dev/null | sed -e "y/|/ /" -ne "s/^.*\(u\|U\|msg_u\)sage.*{\(.*\)}.*$/\2/p")
COMPREPLY=( $( compgen -W '$USLIST' -- "$cur" ) )
}
_cerv()
{
local cur prev
COMPREPLY=()
_get_comp_words_by_ref cur prev
# don't complete for things like killall, ssh and mysql if it's
# the standalone command, rather than the init script
[[ ${COMP_WORDS[0]} != "cerv" ]] && return 0
# don't complete past 2nd token
[ $COMP_CWORD -gt 2 ] && return 0
if [[ $COMP_CWORD -eq 1 && $prev == "cerv" ]]; then
_service_list
else
_service_usage_list
fi
return 0
} &&
complete -F _cerv cerv
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment