- Improve Bash completion to suggest meta-packages after -i or --install options.

This commit is contained in:
2026-06-20 17:57:17 +02:00
parent fea46196d1
commit a0f2ffa0cf
5 changed files with 47 additions and 40 deletions

View File

@@ -39,7 +39,7 @@
# Global Variables
#-----------------------------------------------------------------------------------------------------------------------------------
declare -g VERSION="1.1.2"
declare -g VERSION="1.1.3"
declare -g NAME="mpm"
declare -g HELP="usage: [-h | --help] | [-V | --version] | [-l | --list] | [-i | --install <mpm_name>] [-T | --test] [-v | --verbose] [-r | --repo <repository_url>]"
@@ -118,7 +118,7 @@ mpm_args_parse()
# End of options
--) shift; break;;
*) echo_error "args_parse internal error [$1]!"; exit 1;;
*) echo_error "args_parse internal error [$1]!"; exit 1;;
esac
done
@@ -164,6 +164,7 @@ mpm_mpkg_tag_read()
local mpkg="$1"
local tag="$2"
if [[ "${MPM_REPO}" =~ ^https?:// ]]
then
cmd_exec curl -L "${MPM_REPO}/${mpkg}.mpm" 2>/dev/null | grep -e "${tag}: " | sed -e "s/^${tag}: //"
@@ -184,6 +185,7 @@ mpm_mpkg_desc()
{
local mpkg="$1"
mpm_mpkg_tag_read "${mpkg}" "PKG_DESC"
}
@@ -199,6 +201,7 @@ mpm_mpkg_pkglist()
{
local mpkg="$1"
mpm_mpkg_tag_read "${mpkg}" "PKG_LIST"
}
@@ -216,6 +219,7 @@ mpm_list()
local desc
local pkglist
echo " MPM Name | MPM Description | Package List "
echo "---------------------+----------------------------------+---------------------------------------------------------------------------"