diff options
author | Ulrich Müller <ulm@gentoo.org> | 2013-11-14 18:28:54 +0100 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2013-11-15 09:01:31 +0100 |
commit | 90540744262d70f4e7e56437ce532b35e3382b29 (patch) | |
tree | 8fcb5b464ca4f6ed6f21d6af0e7ae6d236261974 /modules | |
parent | Add maintainer information. (diff) | |
download | eselect-90540744262d70f4e7e56437ce532b35e3382b29.tar.gz eselect-90540744262d70f4e7e56437ce532b35e3382b29.tar.bz2 eselect-90540744262d70f4e7e56437ce532b35e3382b29.zip |
New local option --only-names in modules list action.
* modules/modules.eselect (do_list): New local option --only-names
will output names of modules only, without their description.
This replaces the previous brief output mode behaviour and is
mainly intended for bash completion.
(describe_list_options): New function, documents --only-names.
* bin/eselect.in (es_do_help): Don't force default output mode.
* misc/eselect.bashcomp (_eselect): Call "eselect modules list"
with --only-names option.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/modules.eselect | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/modules/modules.eselect b/modules/modules.eselect index 6a808ec..452321d 100644 --- a/modules/modules.eselect +++ b/modules/modules.eselect @@ -15,13 +15,21 @@ describe_list() { echo "List all available modules" } +describe_list_options() { + echo "--only-names : Output names of modules only" +} + # List all installed modules do_list() { - [[ $# -gt 0 ]] && die -q "Too many parameters" - - local path file module name desc + local only_names path file module name desc local -a extra_modules + if [[ ${1#--} = only-names ]]; then + only_names=1 + shift + fi + [[ $# -gt 0 ]] && die -q "Too many parameters" + for path in "${ESELECT_MODULES_PATH[@]}" ; do [[ -d ${path} ]] || continue for file in "${path}"/*.eselect ; do @@ -30,7 +38,7 @@ do_list() { done done - if is_output_mode brief; then + if [[ -n ${only_names} ]]; then # This is mainly intended for bash completion echo "help" echo "usage" |