Skip to content

Commit

Permalink
all: add version to pkg/cli for troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
deadprogram committed Jul 13, 2021
1 parent b2a247b commit 410f654
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cmd/kd6ctl/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,16 @@ func main() {
port = rootFlagSet.String("p", "/dev/corser/XtiumCLMX41_s0", "port of KD6RMX sensor to use")
)

version := &ffcli.Command{
Name: "version",
ShortUsage: "kd6ctl version",
ShortHelp: "Show version of kd6ctl API.",
Exec: func(_ context.Context, args []string) error {
fmt.Println(kd6rmx.Version)
return nil
},
}

load := &ffcli.Command{
Name: "load",
ShortUsage: "kd6ctl load <preset>",
Expand Down Expand Up @@ -278,7 +288,7 @@ func main() {
ShortUsage: "kd6ctl [flags] <subcommand>",
ShortHelp: "kd6ctl is a command line utility to change config on the KD6RMX contact image sensor.",
FlagSet: rootFlagSet,
Subcommands: []*ffcli.Command{load, save, outputfreq, outputfmt, interp, dark, white, leds, duty},
Subcommands: []*ffcli.Command{version, load, save, outputfreq, outputfmt, interp, dark, white, leds, duty},
Exec: func(context.Context, []string) error {
return flag.ErrHelp
},
Expand Down
3 changes: 3 additions & 0 deletions version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package kd6rmx

const Version = "0.5.0-dev"

0 comments on commit 410f654

Please sign in to comment.