cleanup and add FIXME

This commit is contained in:
2022-10-27 17:07:37 -04:00
parent 23f344fb75
commit 714801b466
2 changed files with 9 additions and 3 deletions

View File

@ -17,18 +17,20 @@ else
awkcmd = "gawk"
endif
# Have to use gawk, default awk (mawk) does not support {0,7} syntax
if executable(awkcmd)
if awkcmd != "disable" && executable(awkcmd)
def LogrotateHelp(word: string)
const searchcmd =<< trim eval END
echo "<=== man logrotate ===>"
COLUMNS=80 man logrotate 2>/dev/null |
{awkcmd} '/^CONFIGURATION FILE DIRECTIVES/,/^SCRIPTS/' | {awkcmd} '
/^ {{7}}%s/,false {{
/^ {{7}}{word}/,false {{
if(firstLineDone && /^ {{0,7}}[^ ]/ && !/endscript/) exit
firstLineDone = 1
print(substr($0, 8))
}}'
END
printf(join(searchcmd, "\n"), word)
searchcmd
->join("\n")
->systemlist()
->popup_atcursor({ "padding": [0, 1, 1, 1] })
enddef