completion: take into account the formatting backticks for options

With the modern formatting of the manpages, the options and commands are now
backticked in their definition lists. This patch updates the generation of
the completion list to take into account this new format.

The script `generate-configlist.sh` is updated to get rid of extraneous
commands and fit everything in a single sed script.

Signed-off-by: Jean-Noël Avila <jn.avila@free.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Jean-Noël Avila
2025-03-19 08:16:22 +00:00
committed by Junio C Hamano
parent 683c54c999
commit e1b81f54da

View File

@@ -13,10 +13,18 @@ print_config_list () {
cat <<EOF cat <<EOF
static const char *config_name_list[] = { static const char *config_name_list[] = {
EOF EOF
grep -h '^[a-zA-Z].*\..*::$' "$SOURCE_DIR"/Documentation/*config.adoc "$SOURCE_DIR"/Documentation/config/*.adoc | sed -E '
sed '/deprecated/d; s/::$//; s/, */\n/g' | /^`?[a-zA-Z].*\..*`?::$/ {
sort | /deprecated/d;
sed 's/^.*$/ "&",/' s/::$//;
s/`//g;
s/^.*$/ "&",/;
s/, */",\n "/g;
p;};
d' \
"$SOURCE_DIR"/Documentation/*config.adoc \
"$SOURCE_DIR"/Documentation/config/*.adoc|
sort
cat <<EOF cat <<EOF
NULL, NULL,
}; };