mirror of
https://github.com/bcicen/ctop.git
synced 2024-08-30 18:23:19 +00:00
define flag vars in block
This commit is contained in:
parent
1c8f4b3a35
commit
1be64f0d11
18
main.go
18
main.go
@ -33,14 +33,16 @@ func main() {
|
||||
defer panicExit()
|
||||
|
||||
// parse command line arguments
|
||||
var versionFlag = flag.Bool("v", false, "output version information and exit")
|
||||
var helpFlag = flag.Bool("h", false, "display this help dialog")
|
||||
var filterFlag = flag.String("f", "", "filter containers")
|
||||
var activeOnlyFlag = flag.Bool("a", false, "show active containers only")
|
||||
var sortFieldFlag = flag.String("s", "", "select container sort field")
|
||||
var reverseSortFlag = flag.Bool("r", false, "reverse container sort order")
|
||||
var invertFlag = flag.Bool("i", false, "invert default colors")
|
||||
var connectorFlag = flag.String("connector", "docker", "container connector to use")
|
||||
var (
|
||||
versionFlag = flag.Bool("v", false, "output version information and exit")
|
||||
helpFlag = flag.Bool("h", false, "display this help dialog")
|
||||
filterFlag = flag.String("f", "", "filter containers")
|
||||
activeOnlyFlag = flag.Bool("a", false, "show active containers only")
|
||||
sortFieldFlag = flag.String("s", "", "select container sort field")
|
||||
reverseSortFlag = flag.Bool("r", false, "reverse container sort order")
|
||||
invertFlag = flag.Bool("i", false, "invert default colors")
|
||||
connectorFlag = flag.String("connector", "docker", "container connector to use")
|
||||
)
|
||||
flag.Parse()
|
||||
|
||||
if *versionFlag {
|
||||
|
Loading…
Reference in New Issue
Block a user