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
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
20 deletions
+69
-20
eepm
bash_completion/eepm
+69
-20
No files found.
bash_completion/eepm
View file @
096670ce
...
@@ -5,46 +5,95 @@
...
@@ -5,46 +5,95 @@
#
#
__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()
__eepm()
{
{
local cur prev
COMPREPLY=( $( epm play --list-all --short ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.sh}' -- "$cur" ) )
COMPREPLY=()
}
_get_comp_words_by_ref cur prev
[[ ${COMP_WORDS[0]} != "epm" ]] && return 0
__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"))
}
# don't complete past 2nd token
__eepm_complete_commands() {
#[ $COMP_CWORD -gt 2 ] && return 0
if [[ $COMP_CWORD -eq 1 && $prev == "epm" ]]; then
local special i
__eepm_list_commands
for ((i = 1; i < ${#COMP_WORDS[@]} - 1; i++)); do
return 0
if [[ ${COMP_WORDS[i]} == @(install|remove|play) ]]; then
special=${COMP_WORDS[i]}
break
fi
fi
done
if [[ $COMP_CWORD -eq 2 && $prev == "install" ]]; then
if [[ -v special ]]; then
case $special in
install)
__eepm_list_available_packages
__eepm_list_available_packages
return 0
return 0
fi
;;
remove)
__eepm_list_installed_packages
return 0
;;
if [[ $COMP_CWORD -eq 2 && $prev == "remove" ]]; then
play)
__eepm_list_available_packages
__eepm_list_available_packages_play
return 0
return 0
;;
esac
else
__eepm_list_commands
fi
fi
}
__eepm()
{
local cur prev
COMPREPLY=()
_get_comp_words_by_ref cur prev
case "${COMP_WORDS[0]}" in
epm)
__eepm_complete_commands ;;
epmi)
__eepm_list_available_packages ;;
epme)
__eepm_list_installed_packages ;;
epmp)
__eepm_list_available_packages_play ;;
*)
return 0 ;;
esac
if [[ $cur == -* ]]; then
__eepm_complete_args
return 0
return 0
fi
} &&
} &&
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