mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 01:43:36 +01:00
tools/check-manpage.sh: update undoc to a simple list.
It didn't handle the case where an undocumented option was was a flag (i.e. didn't end in =), so rework it to be a simple list and use grep. Add some more options we don't document, too. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
b03358e933
commit
93d8e10786
@ -1,20 +0,0 @@
|
||||
{
|
||||
"flags": [
|
||||
"channel-fee-max-base-msat",
|
||||
"channel-fee-max-proportional-thousandths",
|
||||
"funder-fund-probability",
|
||||
"funder-fuzz-percent",
|
||||
"funder-lease-requests-only",
|
||||
"funder-max-their-funding",
|
||||
"funder-min-their-funding",
|
||||
"funder-per-channel-max",
|
||||
"funder-per-channel-min",
|
||||
"funder-policy",
|
||||
"funder-policy-mod",
|
||||
"funder-reserve-tank",
|
||||
"lease-fee-base-sat",
|
||||
"lease-fee-base-msat",
|
||||
"lease-fee-basis",
|
||||
"lease-funding-weight"
|
||||
]
|
||||
}
|
21
doc/undoc-flags.list
Normal file
21
doc/undoc-flags.list
Normal file
@ -0,0 +1,21 @@
|
||||
list-features-only
|
||||
test-daemons-only
|
||||
renepay-debug-mcf
|
||||
renepay-debug-payflow
|
||||
require-confirmed-inputs=
|
||||
channel-fee-max-base-msat=
|
||||
channel-fee-max-proportional-thousandths=
|
||||
funder-fund-probability=
|
||||
funder-fuzz-percent=
|
||||
funder-lease-requests-only=
|
||||
funder-max-their-funding=
|
||||
funder-min-their-funding=
|
||||
funder-per-channel-max=
|
||||
funder-per-channel-min=
|
||||
funder-policy=
|
||||
funder-policy-mod=
|
||||
funder-reserve-tank=
|
||||
lease-fee-base-sat=
|
||||
lease-fee-base-msat=
|
||||
lease-fee-basis=
|
||||
lease-funding-weight=
|
@ -28,8 +28,18 @@ get_cmd_opts()
|
||||
done
|
||||
}
|
||||
|
||||
# Remove undocumented proprieties, usually these proprieties are
|
||||
# under experimental phases.
|
||||
remove_undoc()
|
||||
{
|
||||
# shellcheck disable=SC2162
|
||||
while read OPT; do
|
||||
grep -q "^$OPT$" < doc/undoc-flags.list || echo "$OPT"
|
||||
done
|
||||
}
|
||||
|
||||
# If we don't get any, we failed!
|
||||
CMD_OPTNAMES=$(get_cmd_opts "$1" | sort)
|
||||
CMD_OPTNAMES=$(get_cmd_opts "$1" | sort | remove_undoc)
|
||||
if [ -z "$CMD_OPTNAMES" ]; then
|
||||
echo "Failed to get options from $0!" >&2
|
||||
exit 1
|
||||
@ -38,16 +48,6 @@ fi
|
||||
# Now, gather (long) opt names from man page, make sure they match.
|
||||
MAN_OPTNAMES=$(grep -vi 'deprecated in' "$2" | sed -E -n 's,^\* \*\*(--)?([^*/]*)\*\*(/\*\*-.\*\*)?(=?).*,\2\4,p'| sort)
|
||||
|
||||
# Remove undocumented proprieties, usually these proprieties are
|
||||
# under experimental phases.
|
||||
for flag in $(jq '.flags[]' <doc/undoc-flags.json) ; do
|
||||
# Remove the quotes from the string, so the code will remove
|
||||
# the first and last char in the string.
|
||||
FLAG=$(sed 's/.//;s/.$//' <(echo "$flag"))
|
||||
CMD_OPTNAMES=$(sed "/$FLAG=/d" <(echo "$CMD_OPTNAMES"))
|
||||
done
|
||||
|
||||
|
||||
if [ "$CMD_OPTNAMES" != "$MAN_OPTNAMES" ]; then
|
||||
echo "diff of command names vs manpage names":
|
||||
diff -u --label="$1" <(echo "$CMD_OPTNAMES") --label="$2" <(echo "$MAN_OPTNAMES")
|
||||
|
Loading…
Reference in New Issue
Block a user