It would be helpful for eselect to have an output mode that doesn't flood the screen when you want to use the output in some sort of script or program. This would cause a command like `eselect --no-color --quiet lapack list` to simply list the installed implementations, avoiding list headers, numbering, and the little '*' next to the active implem, since that's accessible via the 'show' action. This way, the output could easily be read into, e.g., an array.
This will be one of the targets for 1.2.x line.
The option should be called --brief not --quiet if we follow GNU coding standards.
At the moment I don't see how this could be implemented other than on a module-by-module basis. The "list" action in modules typically looks like this (from kernel.eselect, but others are similar): do_list() { targets=( $(find_targets ) ) write_list_start "Available kernel symlink targets:" if [[ -n ${targets[@]} ]] ; then local i for (( i = 0 ; i < ${#targets[@]} ; i = i + 1 )) ; do [[ ${targets[${i}]} == \ $(basename $(canonicalise ${ROOT}/usr/src/linux)) ]] && \ targets[${i}]="${targets[${i}]} $(highlight '*' )" done write_numbered_list "${targets[@]}" else write_kv_list_entry "(none found)" "" fi } Changing the output routines to suppress list headings and numbering helps a little, but the "*" for the active target is added by the module. Also, the "non found" for an empty list should be suppressed, but is output by the module.
The --brief option will be available in eselect-1.2 as an experimental feature. For most modules it produces reasonable results, but YMMV. (In reply to comment #3) > Changing the output routines to suppress list headings and numbering helps a > little, but the "*" for the active target is added by the module. There's now a "highlight_marker" function that modules can call for adding the "*", and it will suppress it in brief output mode. See doc/developer-guide.txt for details.
> (In reply to comment #3) > There's now a "highlight_marker" function that modules can call for > adding the "*", and it will suppress it in brief output mode. > See doc/developer-guide.txt for details. Now that eselect-1.2.3 is marked stable on all architectures, it's time to fix the modules. This bug will be used as a tracker. The following example (from kernel.eselect) illustrates what sort of changes should be done for most modules: Function do_list() in eselect-1.1*: do_list() { local i targets=( $(find_targets) ) write_list_start "Available kernel symlink targets:" if [[ ${#targets[@]} -gt 0 ]]; then for (( i = 0; i < ${#targets[@]}; i++ )); do [[ ${targets[i]} = \ $(basename "$(canonicalise "${ROOT}/usr/src/linux")") ]] \ && targets[i]="${targets[${i}]} $(highlight '*')" done write_numbered_list "${targets[@]}" else write_kv_list_entry "(none found)" "" fi } and in eselect-1.2*, with changes for proper support for "brief" output mode: do_list() { local i targets=( $(find_targets) ) write_list_start "Available kernel symlink targets:" for (( i = 0; i < ${#targets[@]}; i++ )); do [[ ${targets[i]} = \ $(basename "$(canonicalise "${ROOT}/usr/src/linux")") ]] \ && targets[i]=$(highlight_marker "${targets[i]}") done write_numbered_list -m "(none found)" "${targets[@]}" } Please note: - use of the "highlight_marker" function which replaces explicit highlight - use of the "-m" option of "write_numbered_list" which automatically takes care of the empty list case
All blockers have been fixed. Closing.