[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#57673: [PATCH] Parse --help messages for pcomplete
From: |
Augusto Stoffel |
Subject: |
bug#57673: [PATCH] Parse --help messages for pcomplete |
Date: |
Thu, 08 Sep 2022 11:34:31 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
Tags: patch
Find attached a “worse is better” approach for pcomplete, where we parse
help messages to generate a list of completions.
This is still a sketch. I've added pcomplete functions for a random
selection of commands to see if this works reasonably, and I think it
probably does. But in any case I don't think it would make sense to try
and add completions as detailed as the ones bash provides; there is an
awful lot of logic in the files under /usr/share/bash-completion and I
don't think anyone would want to redo that work.
Some further comments:
1. I'm a bit unsure whether `pcomplete-parse-help' should return a plain
list of completions or a completion table. The advantage of the
former (which is the current approach) is that it's easier to
manipulate the result of the parsing (cf. the need for that in the
git case). The advantage of returning a completion table is a better
treatment of annotations.
2. I would rather not create a new pcmpl-git.el file (doing so for each
new command doesn't seem very scalable), but I wouldn't know where
else to put that stuff.
0001-Add-pcomplete-parse-help.patch
Description: Text Data