diff --git a/VERSION b/VERSION index 2f45361..1d71ef9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.2 \ No newline at end of file +0.3 \ No newline at end of file diff --git a/cmd/cmd.go b/cmd/cmd.go index 9e83ca2..8510dd4 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -8,6 +8,10 @@ import ( "github.com/zerjioang/ddns-cloudflare/api" ) +const ( + version = "0.3" +) + var rootCmd = &cobra.Command{ Use: "ddns-cloudflare", Short: "CloudFlare DDNS Agent", @@ -44,9 +48,19 @@ var monitorCmd = &cobra.Command{ }, } +var versionCmd = &cobra.Command{ + Use: "version", + Short: "print version", + Long: `prints ddns-cloudflare agent application version`, + Run: func(cmd *cobra.Command, args []string) { + fmt.Println(version) + }, +} + func init() { rootCmd.AddCommand(startCmd) rootCmd.AddCommand(monitorCmd) + rootCmd.AddCommand(versionCmd) } // Execute is the main command line application entry point