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
16c63b6c
Commit
16c63b6c
authored
May 24, 2024
by
Иван Мажукин
Committed by
Vitaly Lipatov
Nov 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bash_completion/eepm: add commands to complete (eterbug #17251)
parent
fd5026cc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
5 deletions
+23
-5
eepm
bash_completion/eepm
+23
-5
No files found.
bash_completion/eepm
View file @
16c63b6c
...
...
@@ -3,9 +3,11 @@
# This completes on a list of all available services for the
# 'serv' command, followed by that script's available commands
#
EEMP_COMMANDS="install|remove|play|update|full-upgrade|Upgrade|search|cl|qf|Install"
__eepm_list_commands()
{
COMPREPLY=( $(echo
"install remove play update full-upgrade"
) )
COMPREPLY=( $(echo
${EEMP_COMMANDS//'|'/' '}
) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]}' -- "$cur" ) )
}
...
...
@@ -26,6 +28,11 @@ __eepm_list_available_packages_play()
COMPREPLY=( $( epm play --list-all --quiet --short ) )
COMPREPLY=( $( compgen -W '${COMPREPLY[@]%.sh}' -- "$cur" ) )
}
#TODO fix spaces in path
__eepm_complete_qf() {
local cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $(compgen -o default -A file -A command -- "$cur") )
}
__eepm_complete_args(){
COMPREPLY=($(compgen -W '-h --help -v --version --verbose --debug
...
...
@@ -40,7 +47,7 @@ __eepm_complete_commands() {
local special i
for ((i = 1; i < ${#COMP_WORDS[@]} - 1; i++)); do
if [[ ${COMP_WORDS[i]} == @(
install|remove|play
) ]]; then
if [[ ${COMP_WORDS[i]} == @(
${EEMP_COMMANDS}
) ]]; then
special=${COMP_WORDS[i]}
break
fi
...
...
@@ -48,7 +55,7 @@ __eepm_complete_commands() {
if [[ -v special ]]; then
case $special in
install)
install
|cl|Install
)
__eepm_list_available_packages
return 0
;;
...
...
@@ -60,7 +67,15 @@ __eepm_complete_commands() {
play)
__eepm_list_available_packages_play
return 0
;;
qf)
__eepm_complete_qf
return 0
;;
*)
return 0
;;
esac
else
__eepm_list_commands
...
...
@@ -78,12 +93,14 @@ __eepm()
case "${COMP_WORDS[0]}" in
epm)
__eepm_complete_commands ;;
epmi)
epmi
|epmcl
)
__eepm_list_available_packages ;;
epme)
__eepm_list_installed_packages ;;
epmp)
__eepm_list_available_packages_play ;;
epmqf)
__eepm_complete_qf ;;
*)
return 0 ;;
esac
...
...
@@ -95,5 +112,6 @@ __eepm()
} &&
# . "/usr/share/bash-completion/bash_completion"
complete -F __eepm epm epmi epme epmp
complete -F __eepm epm epmi epme epmp
epmcl epmqf epmI
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