Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 334537 - bashcomp module: disable should list only activated entries
Summary: bashcomp module: disable should list only activated entries
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: eselect (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Gentoo eselect Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-26 09:45 UTC by Marc Brendecke
Modified: 2011-09-01 20:12 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Brendecke 2010-08-26 09:45:08 UTC
I've added code that only activated entries show when disable is selected.

Reproducible: Always

Steps to Reproduce:
Edit the file: /usr/share/bash-completion/eselect

From:

3)
            case $2 in
                set|enable|disable)
                    possibles=$(eselect "$1" list 2>/dev/null \
                        | sed -n -e "${sedcmd3}") ;;

            esac
            ;;
esac



To:

3)
            case $2 in
                set|enable)
                    possibles=$(eselect "$1" list 2>/dev/null \
                        | sed -n -e "${sedcmd3}") ;;

                disable)
                    possibles=$(eselect "$1" list | grep "*" 2>/dev/null \
                        | sed -n -e "${sedcmd3}") ;;
            esac
            ;;
esac
Actual Results:  
Only activated objects will be shown

Expected Results:  
It show all possibly completions
Comment 1 Ulrich Müller gentoo-dev 2010-08-26 20:02:16 UTC
Is there a specific reason why the solution isn't symmetric? I.e., why shouldn't it suppress activated entries for the "enable" action, too?

Also I have some doubts if other users wouldn't see such a change as over-engineering.

Comment 2 Marc Brendecke 2010-08-29 05:59:16 UTC
(In reply to comment #1)
> Is there a specific reason why the solution isn't symmetric? I.e., why
> shouldn't it suppress activated entries for the "enable" action, too?
> 
> Also I have some doubts if other users wouldn't see such a change as
> over-engineering.
> 
Yeah that's a problem but, can you explain me why the program should display all the possible services? And that without any highlight if a service is enabled or not? 

Ok, you can say, you can filter the active services with:
eselect bashcomp list (--global)|grep "*"

And the question is, why should i do that, when the tool can make this for me?
Why two steps when one is sufficiently?

And the one million dollar question is: why should that be over-engeenered???
Comment 3 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-02-09 05:11:41 UTC
Thanks for the patch and prototype, the only hint for next time is to attach your diffs as reading them on the screen can be bothersome.

FWIW, I'm not the maintainer of this package but I do help with bash-completion. I've seen the number of completion modules grow with time as upstream is very active. Now it is over 200 but I, personally, only have 5 enabled on my system and think this change would be beneficial to users in my situation and seen as an improvement.
Comment 4 Ulrich Müller gentoo-dev 2011-02-09 06:55:23 UTC
Still waiting for an answer to my earlier question:

(In reply to comment #1)
> Is there a specific reason why the solution isn't symmetric? I.e., why
> shouldn't it suppress activated entries for the "enable" action, too?