From 7b2100c5687df272ab6b83fad905b4f3790258fc Mon Sep 17 00:00:00 2001 From: decentral1se Date: Tue, 20 Jul 2021 23:59:47 +0200 Subject: [PATCH] feat: add version command --- TODO.md | 2 +- cli/cli.go | 1 + cli/version.go | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 cli/version.go diff --git a/TODO.md b/TODO.md index 79b13016..e92615fa 100644 --- a/TODO.md +++ b/TODO.md @@ -35,7 +35,7 @@ Disclaimer!: List is WIP - [ ] `release` - [ ] `versions` - [ ] `abra upgrade` - - [ ] `version` + - [x] `version` - [ ] `doctor` - [ ] Refactor code and good comments - [ ] Automated builds and releases (for all OS's and archs) diff --git a/cli/cli.go b/cli/cli.go index c19ec03d..0200b8e1 100644 --- a/cli/cli.go +++ b/cli/cli.go @@ -29,6 +29,7 @@ func RunApp(version, commit string) { }, }, }, + VersionCommand, }, Flags: []cli.Flag{ EnvFlag, diff --git a/cli/version.go b/cli/version.go new file mode 100644 index 00000000..b4441af5 --- /dev/null +++ b/cli/version.go @@ -0,0 +1,14 @@ +package cli + +import ( + "github.com/urfave/cli/v2" +) + +var VersionCommand = &cli.Command{ + Name: "version", + Usage: "Print the version", + Action: func(c *cli.Context) error { + cli.VersionPrinter(c) + return nil + }, +}