[prev in list] [next in list] [prev in thread] [next in thread] 

List:       darcs-devel
Subject:    [darcs-devel] shell completion support
From:       Ben Franksen <ben.franksen () online ! de>
Date:       2017-03-26 20:11:42
Message-ID: c61ce17a-e240-c9e0-06b4-2d2eb95100eb () online ! de
[Download RAW message or body]

Hi Gian Piero and other Darcs Devs

(I am addressing you personally, since you seem to be interested in
getting shell completion into better shape.)

I am working on a number of improvements regarding completion support.
Most importantly, I wanted the list of files shown to take the
difference between working directory and root of the repo into account.
This meant a number of refactorings since the necessary information
wasn't available to the subroutine. This part works for me, now. Before
I send the patches, I want to discuss further goals: there are some
features that would make the completion scripts simpler and improve the
user experience.

One change I have in mind is that options should be listed only if the
current word (the one the cursor is over) starts with a '-'. This can be
done in the completion script by filtering out options when the current
word is empty (i.e. you hit TAB after typing 'darcs apply ') but that is
clumsy and the name "--list-options" anyway doesn't suggest to list
every possible argument.

Therefore I would like --list-options to list *only* options, as (I
think) it did at some point in the past. And add a separate switch for
normal arguments (--list-arguments). Even better would be to separate
this further into --list-files for file completions and --list-arguments
for other argument types (prefs, URLs).

The reason is that for files there is, at least in zsh, extra support
for file-like arguments, e.g. slashes are atomatically appended to
directories and, more importantly, you get presented only the first
level, each time you hit TAB, and not the whole tree in one big list.
(In zsh this works even for things that do not exist as files).

Changing the behaviour of --list-options would break compatibility, so
this needs unanimous aproval.

Another feature I have in mind is to present options and subcommands
together with their (one line) help text. This is easy to achieve if you
bake it into the completion script, but I want to avoid that because
then it must be continuously maintained to be up-to-date. How to do it
instead from inside Darcs is an open question. Perhaps parsing the
--help output would be an option here.

Cheers
Ben

_______________________________________________
darcs-devel mailing list
darcs-devel@darcs.net
http://lists.osuosl.org/mailman/listinfo/darcs-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic