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
096670ce
Commit
096670ce
authored
Apr 13, 2024
by
Иван Мажукин
Committed by
Vitaly Lipatov
Apr 26, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bash completion update (eterbug #17251)
parent
9779f803
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
22 deletions
+71
-22
eepm
bash_completion/eepm
+71
-22
No files found.
bash_completion/eepm
View file @
096670ce
...
@@ -2,19 +2,69 @@
...
@@ -2,19 +2,69 @@
# This completes on a list of all available services for the
# This completes on a list of all available services for the
# 'serv' command, followed by that script's available commands
# 'serv' command, followed by that script's available commands
#
#
__eepm_list_commands()
__eepm_list_commands()
{
{
COMPREPLY=( $(echo "install remove") )
COMPREPLY=( $(echo "install remove play update full-upgrade") )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
__eepm_list_installed_packages()
{
COMPREPLY=( $( epm list --installed --quiet --short) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
}
__eepm_list_available_packages()
__eepm_list_available_packages()
{
{
COMPREPLY=( $( cat /var/lib/eepm/available-packages 2>/dev/null ) )
COMPREPLY=( $( cat /var/lib/eepm/available-packages 2>/dev/null ) )
#local USLIST=$(serv ${prev##*/} usage 2>/dev/null | sed -e "y/|/ /" -ne "s/^.*\(u\|U\|msg_u\)sage.*{\(.*\)}.*$/\2/p")
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
#COMPREPLY=( $( compgen -W '$USLIST' -- "$cur" ) )
}
__eepm_list_available_packages_play()
{
COMPREPLY=( $( epm play --list-all --short ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.sh}' -- "$cur" ) )
}
__eepm_complete_args(){
COMPREPLY=($(compgen -W '-h --help -v --version --verbose --debug
--skip-installed --skip-missed --show-command-only --quiet --silent --nodeps
--force --noremove --no-remove --no-stdin --inscript
--dry-run --simulate --just-print --no-act --short --direct --repack --norepack --install
--scripts --noscripts --save-only --put-to-repo= --download-only --url --sort -y --auto
--assumeyes --non-interactive --disable-interactivity --interactive --force-yes' -- "$cur"))
}
__eepm_complete_commands() {
local special i
for ((i = 1; i < ${#COMP_WORDS[@]} - 1; i++)); do
if [[ ${COMP_WORDS[i]} == @(install|remove|play) ]]; then
special=${COMP_WORDS[i]}
break
fi
done
if [[ -v special ]]; then
case $special in
install)
__eepm_list_available_packages
return 0
;;
remove)
__eepm_list_installed_packages
return 0
;;
play)
__eepm_list_available_packages_play
return 0
;;
esac
else
__eepm_list_commands
fi
}
}
...
@@ -25,26 +75,25 @@ __eepm()
...
@@ -25,26 +75,25 @@ __eepm()
COMPREPLY=()
COMPREPLY=()
_get_comp_words_by_ref cur prev
_get_comp_words_by_ref cur prev
[[ ${COMP_WORDS[0]} != "epm" ]] && return 0
case "${COMP_WORDS[0]}" in
epm)
# don't complete past 2nd token
__eepm_complete_commands ;;
#[ $COMP_CWORD -gt 2 ] && return 0
epmi)
__eepm_list_available_packages ;;
epme)
__eepm_list_installed_packages ;;
epmp)
__eepm_list_available_packages_play ;;
*)
return 0 ;;
esac
if [[ $
COMP_CWORD -eq 1 && $prev == "epm"
]]; then
if [[ $
cur == -*
]]; then
__eepm_
list_command
s
__eepm_
complete_arg
s
return 0
return 0
fi
fi
if [[ $COMP_CWORD -eq 2 && $prev == "install" ]]; then
__eepm_list_available_packages
return 0
fi
if [[ $COMP_CWORD -eq 2 && $prev == "remove" ]]; then
__eepm_list_available_packages
return 0
fi
return 0
} &&
} &&
complete -F __eepm epm
# . "/usr/share/bash-completion/bash_completion"
complete -F __eepm epm epmi epme epmp
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