package cmd import ( "flag" "fmt" ) func List(params []string) { flags := flag.NewFlagSet("list", flag.ExitOnError) var withPaths bool const WITH_PATHS_HELP = "print paths to the provided reference within the snapshot" flags.BoolVar(&withPaths, "paths", false, WITH_PATHS_HELP); flags.BoolVar(&withPaths, "p", false, WITH_PATHS_HELP); flags.Parse(params); fmt.Printf("Your flag is: %t", withPaths); }