Skip to content

Commit

Permalink
fix print bug
Browse files Browse the repository at this point in the history
  • Loading branch information
shadowabi committed Apr 27, 2024
1 parent e4e1da6 commit e826877
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ var logLevel string
func init() {
RootCmd.PersistentFlags().StringVar(&logLevel, "logLevel", "info", "设置日志等级 (Set log level) [trace|debug|info|warn|error|fatal|panic]")
RootCmd.CompletionOptions.DisableDefaultCmd = true
RootCmd.SetHelpFunc(customHelpFunc)
RootCmd.PersistentFlags().StringVarP(&define.File, "file", "f", "", "从文件中读取目标地址 (Input FILENAME)")
RootCmd.PersistentFlags().StringVarP(&define.Url, "url", "u", "", "输入目标地址 (Input [ip|domain|url])")
RootCmd.PersistentFlags().IntVarP(&define.TimeOut, "timeout", "t", 15, "输入每个 http 请求的超时时间 (Enter the timeout period for every http request)")
Expand All @@ -62,3 +63,7 @@ func Execute() {
os.Exit(1)
}
}

func customHelpFunc(cmd *cobra.Command, args []string) {
cmd.Usage()
}

0 comments on commit e826877

Please sign in to comment.