11package main
22
33import (
4- "context"
54 "encoding/json"
65 "fmt"
76 "io"
@@ -12,7 +11,7 @@ import (
1211 kvfile_compress "github.com/aperturerobotics/go-kvfile/compress"
1312 b58 "github.com/mr-tron/base58/base58"
1413 "github.com/pkg/errors"
15- "github.com/urfave /cli/v3 "
14+ "github.com/aperturerobotics /cli"
1615)
1716
1817var (
@@ -25,11 +24,11 @@ var (
2524)
2625
2726func main () {
28- app := & cli.Command {
27+ app := & cli.App {
2928 Name : "kvfile" ,
3029 Usage : "A CLI tool for working with key-value files" ,
31- Authors : []any {
32- "Christian Stewart < christian@aperture.us>" ,
30+ Authors : []* cli. Author {
31+ { Name : "Christian Stewart" , Email : " christian@aperture.us" } ,
3332 },
3433 Flags : []cli.Flag {
3534 & cli.BoolFlag {
@@ -62,7 +61,7 @@ func main() {
6261 {
6362 Name : "count" ,
6463 Usage : "Print the number of keys in a k/v file." ,
65- Action : func (ctx context. Context , c * cli.Command ) error {
64+ Action : func (c * cli.Context ) error {
6665 reader , rel , err := openKVFile (filePath )
6766 if rel != nil {
6867 defer rel ()
@@ -79,7 +78,7 @@ func main() {
7978 {
8079 Name : "keys" ,
8180 Usage : "Print all keys in a k/v file in sorted order." ,
82- Action : func (ctx context. Context , c * cli.Command ) error {
81+ Action : func (c * cli.Context ) error {
8382 reader , rel , err := openKVFile (filePath )
8483 if rel != nil {
8584 defer rel ()
@@ -94,7 +93,7 @@ func main() {
9493 {
9594 Name : "values" ,
9695 Usage : "Print all key-value pairs in a k/v file." ,
97- Action : func (ctx context. Context , c * cli.Command ) error {
96+ Action : func (c * cli.Context ) error {
9897 reader , rel , err := openKVFile (filePath )
9998 if rel != nil {
10099 defer rel ()
@@ -117,7 +116,7 @@ func main() {
117116 Destination : & keyStr ,
118117 },
119118 },
120- Action : func (ctx context. Context , c * cli.Command ) error {
119+ Action : func (c * cli.Context ) error {
121120 if keyStr == "" {
122121 return fmt .Errorf ("please provide a key" )
123122 }
@@ -152,7 +151,7 @@ func main() {
152151 Destination : & valueStr ,
153152 },
154153 },
155- Action : func (ctx context. Context , c * cli.Command ) error {
154+ Action : func (c * cli.Context ) error {
156155 if filePath == "" {
157156 return fmt .Errorf ("please provide a file path" )
158157 }
@@ -191,7 +190,7 @@ func main() {
191190 },
192191 }
193192
194- err := app .Run (context . Background (), os .Args )
193+ err := app .Run (os .Args )
195194 if err != nil {
196195 os .Stderr .WriteString (err .Error () + "\n " )
197196 os .Exit (1 )
0 commit comments