]> Cypherpunks repositories - keks.git/commitdiff
Slightly better usage information
authorSergey Matveev <stargrave@stargrave.org>
Sat, 12 Apr 2025 06:57:58 +0000 (09:57 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Sat, 12 Apr 2025 06:57:58 +0000 (09:57 +0300)
c/cmd/pub-verify/pub-verify.c
c/cmd/test-vector/test-vector.c
go/cmd/pp/main.go
go/cmd/schema-validate/main.go
go/cmd/test-vector-anys/main.go
go/cmd/test-vector-manual/main.go
go/cmd/textdump-tester/main.go

index 3041e122bf682309f03e3d2afae7101138416c1ed20784373edb62f30051e621..d55e3093357e6dec3e930348038cfe4a2818df7c932ac80f5b36b7fb5eb1748b 100644 (file)
@@ -1,4 +1,4 @@
-// CKEKS -- C99 KEKS encoder implementation
+// pub-verify -- verify a chain of cm/pub keys
 // Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
index f49862fd6f54cd2fd8b86cbdcd0be35f483178236e0ebd4bbd7aa675dce10f77..ecb204c13280807a0a2d645aed1aaaf7f87c1f6ee8267091e26424881de82340 100644 (file)
@@ -1,3 +1,18 @@
+// test-vector -- KEKS test structure
+// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 #include <assert.h>
 #include <stdbool.h>
 #include <stdint.h>
index cedfd4207d6c84f7fae2a5fdca4e951618e91c1d70e4ff2f108309933283e344..3099959924b26fc2a4cf48751600684aa2b3bdc280807a5675421d618e159455 100644 (file)
@@ -1,4 +1,4 @@
-// GoKEKS -- Go KEKS codec implementation
+// test-vector -- KEKS test structure
 // Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
@@ -33,6 +33,19 @@ import (
        "go.cypherpunks.su/tai64n/v4"
 )
 
+func usage() {
+       fmt.Fprintf(os.Stderr, `Usage: pp [options] <DATA.keks
+
+`)
+       flag.PrintDefaults()
+       fmt.Fprintf(os.Stderr, `
+/that/keks/path specifies some exact element of the structure.
+For example, /sigs/0/tbs will show only tbs field of the first signature in
+cm/pub structure. With "-v -p /sigs/0/tbs/sid" option you will get hexadecimal
+value of the signature's sid.
+`)
+}
+
 var (
        MaxStrLen = flag.Uint("max-str-len", 64,
                "Maximal string length to print")
@@ -144,7 +157,11 @@ func printer(iter *keks.Iterator, where []string, count int, inList, inMap bool)
                        }
                case types.Hexlet:
                        h := iter.Hexlet()
-                       fmt.Println(h.UUID(), h.IP())
+                       if *onlyV {
+                               fmt.Println(h.UUID())
+                       } else {
+                               fmt.Println(h.UUID(), h.IP())
+                       }
                case types.UInt:
                        fmt.Println(iter.UInt())
                case types.Int:
@@ -234,6 +251,7 @@ func printer(iter *keks.Iterator, where []string, count int, inList, inMap bool)
 }
 
 func main() {
+       flag.Usage = usage
        flag.Parse()
        if *pthStr != "" {
                pth = strings.Split(strings.TrimLeft(*pthStr, "/"), "/")
index b5927eeca02872c68e52aa8531d25c35ea8a6a23178066a1fde0026cace35810..f78673b56fc8ab90117f363ae7bd616d6448bfd76dd4a7a994e490a60d101b57 100644 (file)
@@ -1,4 +1,4 @@
-// schema-validate KEKS data structures validator
+// schema-validate -- KEKS data structures validator
 // Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify
index f85c83e96ab889fa86d98ca6929d13d85d7906c0e8617f69f604d1dbe693e542..80ca7b320fdfc0df1ecfda3b78d548c06105bbef6ed3f6e5dc7115f3160fc8fa 100644 (file)
@@ -1,3 +1,18 @@
+// test-vector-anys -- KEKS test structure with any-types
+// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 package main
 
 import (
index d8d667959d1e88ac220519873f306c839812aef543f0b539a4ccde7ca17fda63..6e71f397a54df290f5842d274a59484354732629f0a56647e317151da6b22ad4 100644 (file)
@@ -1,3 +1,18 @@
+// test-vector-manual -- KEKS test structure with manually encoded fields
+// Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
+//
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as
+// published by the Free Software Foundation, version 3 of the License.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
 package main
 
 import (
index d9076bb239c508db529c19cd9483b12311bdf1fd599a02c61af0085bc1bf3d8e..ad15cd7d1b1df3f4af564986b3d6b102697aa52bf3138e80c65f04d53b21c7d9 100644 (file)
@@ -1,4 +1,4 @@
-// GoKEKS -- Go KEKS codec implementation
+// textdump-tester -- test utility for Python's textdump-tester
 // Copyright (C) 2024-2025 Sergey Matveev <stargrave@stargrave.org>
 //
 // This program is free software: you can redistribute it and/or modify