Open Farid-NL opened 1 month ago
Thanks for being game to talk this through and try different things.
Thanks for being game to talk this through and try different things.
Glad I can help!
Sorry for the delay, some life related stuff.
I have a question regarding some examples to test
# for ' and "
abbr -S 'a"b"c'=d
abbr -S "a'b'c"=e
How would you normally erase/rename these abbreviations? What would you put exactly to erase/rename them?
I'm getting
abbr erase: No abbreviation `abc` found
or
abbr rename: No abbreviation `abc` found
Sorry for the delay, some life related stuff.
No apologies necessary, take all the time you need.
How would you normally erase/rename these abbreviations?
So, with that limitation in mind what would be the next steps to green light the PR?
Right now just certain characters (#118) doesn't seem to work in abbreviations, expansions with those characters work however (they are shown correctly in the completion's description).
# Display de completion properly the action (rename/erase) works.
abbr -S a:=b
abbr -S b=a:
abbr -S a="b="
abbr -S we="asd^asd\"hey\""
abbr -S wa="as\!hey"
# Display the completion properly but it won´t rename/erase it
abbr -S 'a"b"c'=d
abbr -S "a'b'c"=e
Hi! :wave:
The main goal of this PR is to provide a list of abbreviations when calling the
erase
andrename
commands.There were other improvements I made a long the way though
Using double quotes only when necessary
Reasoning
Even though could be a performance improvement between using single or double quotes... this might be my OCD triggered.
Separate options from commands
Reasoning
Normally when pressing Tab you expect just the list of commands, but not the options i.e.
--help
. These will only show up when typing-
→ Tab (for short and long flags) or--
→ Tab (for long flags).Demo
List abbreviations when using
erase
andrename
commandsReasoning
Maybe you don't use an abbreviation anymore, so instead of listing the abbreviations manually, an then type it into the
erase
orrename
command, you can search for it wit the help of the completion system.Features
Demo
Group related options and set exceptions when using a particular group
Reasoning
There could be multiple options for a specific context, for example:
[<SCOPE>]
:User (-U || --user), Session (-S || --session)
[<TYPE>]
:Regular (-r || --regular), Global (-g || --global)
[<QUIET_MODE>]
:Quiet (-q || --quiet), Quieter (-qq || --quieter)
So when one is chosen, the other options for the same context should not be shown.
Example:
-S
is used, then--session
,-U
and--user
are not shown.Demo