define flag vars in block

This commit is contained in:
Bradley Cicenas 2017-11-29 03:03:46 +00:00
parent 1c8f4b3a35
commit 1be64f0d11

18
main.go
View File

@ -33,14 +33,16 @@ func main() {
defer panicExit() defer panicExit()
// parse command line arguments // parse command line arguments
var versionFlag = flag.Bool("v", false, "output version information and exit") var (
var helpFlag = flag.Bool("h", false, "display this help dialog") versionFlag = flag.Bool("v", false, "output version information and exit")
var filterFlag = flag.String("f", "", "filter containers") helpFlag = flag.Bool("h", false, "display this help dialog")
var activeOnlyFlag = flag.Bool("a", false, "show active containers only") filterFlag = flag.String("f", "", "filter containers")
var sortFieldFlag = flag.String("s", "", "select container sort field") activeOnlyFlag = flag.Bool("a", false, "show active containers only")
var reverseSortFlag = flag.Bool("r", false, "reverse container sort order") sortFieldFlag = flag.String("s", "", "select container sort field")
var invertFlag = flag.Bool("i", false, "invert default colors") reverseSortFlag = flag.Bool("r", false, "reverse container sort order")
var connectorFlag = flag.String("connector", "docker", "container connector to use") invertFlag = flag.Bool("i", false, "invert default colors")
connectorFlag = flag.String("connector", "docker", "container connector to use")
)
flag.Parse() flag.Parse()
if *versionFlag { if *versionFlag {