From fd22426b3db5b49664a80db7c10b2e503151c16e Mon Sep 17 00:00:00 2001 From: "@0xb17bea125" Date: Sun, 4 Dec 2022 15:57:13 +0900 Subject: [PATCH] tzif: add help_tzif.fqtest --- format/tzif/testdata/generate_fqtest.sh | 3 +++ format/tzif/testdata/help_tzif.fqtest | 29 +++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 format/tzif/testdata/help_tzif.fqtest diff --git a/format/tzif/testdata/generate_fqtest.sh b/format/tzif/testdata/generate_fqtest.sh index e21fbf2c..7470b14a 100755 --- a/format/tzif/testdata/generate_fqtest.sh +++ b/format/tzif/testdata/generate_fqtest.sh @@ -49,6 +49,9 @@ tear_down() { if grep "error" ./*.fqtest; then exit 1 fi + + echo '$ fq -h tzif' > help_tzif.fqtest + ../../../fq -h tzif >> help_tzif.fqtest ) result=0 diff --git a/format/tzif/testdata/help_tzif.fqtest b/format/tzif/testdata/help_tzif.fqtest new file mode 100644 index 00000000..c1c8c216 --- /dev/null +++ b/format/tzif/testdata/help_tzif.fqtest @@ -0,0 +1,29 @@ +$ fq -h tzif +tzif: Time Zone Information Format decoder + +Decode examples +=============== + + # Decode file as tzif + $ fq -d tzif . file + # Decode value as tzif + ... | tzif + +Get last transition time +======================== + + fq '.v2plusdatablock.transition_times[-1] | tovalue' tziffile + +Count leap second records +========================= + + fq '.v2plusdatablock.leap_second_records | length' tziffile + +Authors +======= +- Takashi Oguma @bitbears-dev (https://github.com/bitbears-dev) @0xb17bea125 (https://twitter.com/0xb17bea125) + +References +========== +- https://datatracker.ietf.org/doc/html/rfc8536 +