NewCmd returns a new version command
(ctx context.DnoteCtx)
| 24 | |
| 25 | // NewCmd returns a new version command |
| 26 | func NewCmd(ctx context.DnoteCtx) *cobra.Command { |
| 27 | cmd := &cobra.Command{ |
| 28 | Use: "version", |
| 29 | Short: "Print the version number of Dnote", |
| 30 | Long: "Print the version number of Dnote", |
| 31 | Run: func(cmd *cobra.Command, args []string) { |
| 32 | fmt.Printf("dnote %s\n", ctx.Version) |
| 33 | }, |
| 34 | } |
| 35 | |
| 36 | return cmd |
| 37 | } |