Skip to content

Commit cd907cc

Browse files
committed
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 <[email protected]>
1 parent 683c54c commit cd907cc

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

generate-configlist.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,18 @@ print_config_list () {
1313
cat <<EOF
1414
static const char *config_name_list[] = {
1515
EOF
16-
grep -h '^[a-zA-Z].*\..*::$' "$SOURCE_DIR"/Documentation/*config.adoc "$SOURCE_DIR"/Documentation/config/*.adoc |
17-
sed '/deprecated/d; s/::$//; s/, */\n/g' |
18-
sort |
19-
sed 's/^.*$/ "&",/'
16+
sed -E '
17+
/^`?[a-zA-Z].*\..*`?::$/ {
18+
/deprecated/d;
19+
s/::$//;
20+
s/`//g;
21+
s/^.*$/ "&",/;
22+
s/, */",\n "/g;
23+
p;};
24+
d' \
25+
"$SOURCE_DIR"/Documentation/*config.adoc \
26+
"$SOURCE_DIR"/Documentation/config/*.adoc|
27+
sort
2028
cat <<EOF
2129
NULL,
2230
};

0 commit comments

Comments
 (0)