Makefile: print messages.

master
Philippe Pittoli 2023-06-15 13:06:55 +02:00
parent 225d606807
commit 776ee3ffe4
2 changed files with 39 additions and 0 deletions

View File

@ -49,3 +49,16 @@ run-client-zone-list:
run-dnsmanagerd:
@$(LD_P) ./bin/dnsmanagerd -v 4 -r /tmp/DATA-dnsmanagerd -k $(KEY_FILE)
print-messages:
cat src/requests/*.cr | ./bin/get-messages.awk
print-message-numbers:
make -s print-messages | grep -E "^[0-9]" | sort -n
print-messages-without-comments:
make -s print-messages | grep -vE '^[[:blank:]]+#'
print-response-messages:
cat src/responses/*.cr | ./bin/get-messages.awk
print-response-message-numbers:
make -s print-response-messages | grep -E "^[0-9]" | sort -n
print-response-messages-without-comments:
make -s print-response-messages | grep -vE '^[[:blank:]]+#'

26
bin/get-messages.awk Executable file
View File

@ -0,0 +1,26 @@
#!/bin/awk -f
# Provides message parameters and numbers.
# Use: cat src/requests/*.cr | ./bin/get-messages.awk
BEGIN {
OFS="\t"
should_print = 0
}
/def initialize/ {
should_print = 0
print ""
}
# Print line only when we should:
# - when in a message class
# - when the line isn't empty
should_print == 1 && /[0-9a-zA-Z]/ {
print
}
/IPC::JSON.message/ || /IPC::CBOR.message/ {
print $3, $2
should_print = 1
}