diff --git a/README.md b/README.md index 847a72d..320e9cd 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ Flags: -c, --content-format int Content format (default 50) -h, --help help for coap-cli -H, --host string Host (default "localhost") - -k, --keep-alive uint Keep alive interval (default 60) + -k, --keep-alive uint Send a ping after interval seconds of inactivity. If not specified (or 0), keep-alive is disabled (default). -m, --max-retries uint32 Max retries for keep alive (default 10) - -O, --options stringArray Options + -O, --options num,text Add option num with contents of text to the request. If the text begins with 0x, then the hex text (two [0-9a-f] per byte) is converted to binary data. -p, --port string Port (default "5683") -v, --verbose Verbose output -d, --data string Data(default "") - only available for put, post and delete commands diff --git a/cmd/main.go b/cmd/main.go index 136a5cd..c184ee4 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -83,8 +83,8 @@ func main() { rootCmd.PersistentFlags().StringVarP(&port, "port", "p", "5683", "Port") rootCmd.PersistentFlags().StringVarP(&auth, "auth", "a", "", "Auth") rootCmd.PersistentFlags().IntVarP(&contentFormat, "content-format", "c", 50, "Content format") - rootCmd.PersistentFlags().StringArrayVarP(&options, "options", "O", []string{}, "Options") - rootCmd.PersistentFlags().Uint64VarP(&keepAlive, "keep-alive", "k", 60, "Keep alive interval") + rootCmd.PersistentFlags().StringArrayVarP(&options, "options", "O", []string{}, "Add option num with contents of text to the request. If the text begins with 0x, then the hex text (two [0-9a-f] per byte) is converted to binary data.") + rootCmd.PersistentFlags().Uint64VarP(&keepAlive, "keep-alive", "k", 0, "Send a ping after interval seconds of inactivity. If not specified (or 0), keep-alive is disabled (default).") rootCmd.PersistentFlags().Uint32VarP(&maxRetries, "max-retries", "m", 10, "Max retries for keep alive") rootCmd.PersistentFlags().BoolVarP(&verbose, "verbose", "v", false, "Verbose output") diff --git a/go.mod b/go.mod index 1b14067..340c1c2 100644 --- a/go.mod +++ b/go.mod @@ -3,13 +3,13 @@ module github.com/absmach/coap-cli go 1.22 require ( + github.com/fatih/color v1.17.0 github.com/plgd-dev/go-coap/v3 v3.3.4 github.com/spf13/cobra v1.8.0 ) require ( github.com/dsnet/golib/memfile v1.0.0 // indirect - github.com/fatih/color v1.16.0 github.com/hashicorp/errwrap v1.1.0 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect diff --git a/go.sum b/go.sum index 35bcbf2..f9c5817 100644 --- a/go.sum +++ b/go.sum @@ -4,8 +4,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/dsnet/golib/memfile v1.0.0 h1:J9pUspY2bDCbF9o+YGwcf3uG6MdyITfh/Fk3/CaEiFs= github.com/dsnet/golib/memfile v1.0.0/go.mod h1:tXGNW9q3RwvWt1VV2qrRKlSSz0npnh12yftCSCy2T64= -github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM= -github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE= +github.com/fatih/color v1.17.0 h1:GlRw1BRJxkpqUCBKzKOw098ed57fEsKeNjpTe3cSjK4= +github.com/fatih/color v1.17.0/go.mod h1:YZ7TlrGPkiz6ku9fK3TLD/pl3CpsiFyu8N92HLgmosI= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=