diff options
author | Koni Marti <koni.marti@gmail.com> | 2023-11-24 16:02:56 +0100 |
---|---|---|
committer | Robin Jarry <robin@jarry.cc> | 2023-12-30 15:42:09 +0100 |
commit | 60c1c7347ad88ad00fc0809acd10ddd31243acd3 (patch) | |
tree | 7c438a21c61f62ff1cb08450b06bb8bbd25dc2af /contrib/check-docs | |
parent | f75d4b7bb615df6c20546961870672c0f1680999 (diff) | |
download | aerc-60c1c7347ad88ad00fc0809acd10ddd31243acd3.tar.gz |
contrib: fix check-docs for subcommands
Fix check-docs linter for subcommands, i.e. where spaces are between the
root command and the subcommands such as in ":patch init".
Signed-off-by: Koni Marti <koni.marti@gmail.com>
Acked-by: Robin Jarry <robin@jarry.cc>
Diffstat (limited to 'contrib/check-docs')
-rwxr-xr-x | contrib/check-docs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/check-docs b/contrib/check-docs index dd783a82..bcc63213 100755 --- a/contrib/check-docs +++ b/contrib/check-docs @@ -5,7 +5,7 @@ trap "rm -f $tmp" EXIT global_fail=0 -cmd_scd_sed='s/^\*:([a-z][a-z-]*)\*.*/\1/p' +cmd_scd_sed='s/^\*:([a-z][a-z -]*)\*.*/\1/p' cmd_go_sed='/^func ([[:alnum:]][[:alnum:]]*) Aliases() \[\]string {$/{n; s/", "/ /g; s/.*return \[\]string{"\(.*\)"}/\1/p @@ -17,7 +17,7 @@ if echo . | grep --color . >/dev/null 2>&1; then fi fail=0 -sed -nre "$cmd_scd_sed" doc/*.scd > "$tmp" +sed -nre "$cmd_scd_sed" doc/*.scd | tr ' ' '\n' > "$tmp" for f in $(find commands -type f -name '*.go'); do for cmd in $(sed -ne "$cmd_go_sed" "$f"); do if ! grep -qFx "$cmd" "$tmp"; then @@ -35,7 +35,7 @@ fi fail=0 sed -ne "$cmd_go_sed" $(find commands -type f -name '*.go') | tr ' ' '\n' > "$tmp" for f in doc/*.scd; do - for cmd in $(sed -nre "$cmd_scd_sed" "$f"); do + for cmd in $(sed -nre "$cmd_scd_sed" "$f" | tr ' ' '\n' | sed '/^-/d;/^$/d'); do if ! grep -qFx "$cmd" "$tmp"; then grep -Hn $grep_color "^\\*:$cmd\\*" "$f" fail=$((fail+1)) |