go pflag
go pflag
1 package main 2 3 import ( 4 "fmt" 5 "github.com/spf13/pflag" 6 ) 7 8 var ( 9 help = pflag.BoolP("help", "h", false, "Show this help message.") 10 ) 11 12 func main() { 13 pflag.Parse() 14 if *help { 15 pflag.Usage() 16 return 17 } 18 fmt.Println(123) 19 }
休对故人思故国 且将新火试新茶 诗酒趁年华