From fda0c4e2afdbc47846960c127c70869193df104b Mon Sep 17 00:00:00 2001 From: Hedzr Yeh Date: Fri, 9 Oct 2020 22:29:28 +0800 Subject: [PATCH] final release v1.1.9 for Homebrew publication ready. --- cli/main.go | 20 +++++++++++--------- doc.go | 4 ++-- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/cli/main.go b/cli/main.go index c0506d3..d8c3512 100644 --- a/cli/main.go +++ b/cli/main.go @@ -5,6 +5,7 @@ package main import ( + "fmt" "github.com/hedzr/awesome-tool" "github.com/hedzr/awesome-tool/ags" "github.com/hedzr/cmdr" @@ -40,15 +41,6 @@ func Entry() { func buildRootCmd() (rootCmd *cmdr.RootCommand) { - // To disable internal commands and flags, uncomment the following codes - // cmdr.EnableVersionCommands = false - // cmdr.EnableVerboseCommands = false - // cmdr.EnableCmdrCommands = false - // cmdr.EnableHelpCommands = false - // cmdr.EnableGenerateCommands = false - - // daemon.Enable(server.NewDaemon(), modifier, onAppStart, onAppExit) - // root root := cmdr.Root(awesome_tool.AppName, awesome_tool.Version). @@ -58,6 +50,16 @@ func buildRootCmd() (rootCmd *cmdr.RootCommand) { Examples(examples) rootCmd = root.RootCommand() + // info + + root.NewSubCommand(). + Titles("info", "i"). + Description("debug information...", ``). + Action(func(cmd *cmdr.Command, args []string) (err error) { + fmt.Printf("'nothing' in config file is: %q\n", cmdr.GetStringR("nothing")) + return + }) + // build buildCmd := root.NewSubCommand(). diff --git a/doc.go b/doc.go index 554d4b3..52fb7ec 100644 --- a/doc.go +++ b/doc.go @@ -8,9 +8,9 @@ const ( // AppName const AppName = "awesome-tool" // main app-name // Version const - Version = "1.1.8" // version name + Version = "1.1.9" // version name // VersionInt const - VersionInt = 0x010108 // using as + VersionInt = 0x010109 // using as ) // func GetApiPrefix() string {