Skip to content

Commit 5f28607

Browse files
committed
cli: add version command
1 parent 945bfcc commit 5f28607

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545
- name: Build CLI binary
4646
run: go build -o rd-test ./rd/main.go
4747
- name: Verify CLI binary
48-
run: ./rd-test
48+
run: ./rd-test version

rd/cmd/version.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package cmd
2+
3+
import (
4+
"fmt"
5+
6+
"github.com/spf13/cobra"
7+
)
8+
9+
const VERSION = "v0.1.1"
10+
11+
var versionCmd = &cobra.Command{
12+
Use: "version",
13+
Short: "Show version information",
14+
Long: `Show version information of RealDebrid CLI tool.`,
15+
Run: func(cmd *cobra.Command, args []string) {
16+
fmt.Printf("%s\n", VERSION)
17+
},
18+
}
19+
20+
func init() {
21+
rootCmd.AddCommand(versionCmd)
22+
}

0 commit comments

Comments
 (0)