#16 Fix compile against latest urfave/cli.
Merged 5 years ago by qulogic. Opened 5 years ago by qulogic.
qulogic/golist fix-cli  into  master

file modified
+52 -13
@@ -22,19 +22,58 @@ 

  	app.Version = "0.9.0"

  

  	app.Flags = []cli.Flag{

- 		cli.StringSliceFlag{"ignore-dir, d", nil, "Directory to ignore", "", false},

- 		cli.StringSliceFlag{"ignore-tree, t", nil, "Directory tree to ignore", "", false},

- 		cli.StringSliceFlag{"ignore-regex, r", nil, "Regex specified files/dirs to ignore", "", false},

- 		cli.StringFlag{"package-path", "", "Package entry point", "", nil, false},

- 		cli.BoolFlag{"all-deps", "List imported packages including stdlib", "", nil, false},

- 		cli.BoolFlag{"provided", "List provided packages", "", nil, false},

- 		cli.BoolFlag{"imported", "List imported packages", "", nil, false},

- 		cli.BoolFlag{"skip-self", "Skip imported packages with the same --package-path", "", nil, false},

- 		cli.BoolFlag{"tests", "Apply the listing options over tests", "", nil, false},

- 		cli.BoolFlag{"show-main", "Including main files in listings", "", nil, false},

- 		cli.BoolFlag{"to-install", "List all resources recognized as essential part of the Go project", "", nil, false},

- 		cli.StringSliceFlag{"include-extension, e", nil, "Include all files with the extension in the recognized resources, e.g. .proto, .tmpl", "", false},

- 		cli.BoolFlag{"json", "Output as JSON artefact", "", nil, false},

+ 		cli.StringSliceFlag{

+ 			Name:  "ignore-dir, d",

+ 			Usage: "Directory to ignore",

+ 		},

+ 		cli.StringSliceFlag{

+ 			Name:  "ignore-tree, t",

+ 			Usage: "Directory tree to ignore",

+ 		},

+ 		cli.StringSliceFlag{

+ 			Name:  "ignore-regex, r",

+ 			Usage: "Regex specified files/dirs to ignore",

+ 		},

+ 		cli.StringFlag{

+ 			Name:  "package-path",

+ 			Usage: "Package entry point",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "all-deps",

+ 			Usage: "List imported packages including stdlib",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "provided",

+ 			Usage: "List provided packages",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "imported",

+ 			Usage: "List imported packages",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "skip-self",

+ 			Usage: "Skip imported packages with the same --package-path",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "tests",

+ 			Usage: "Apply the listing options over tests",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "show-main",

+ 			Usage: "Including main files in listings",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "to-install",

+ 			Usage: "List all resources recognized as essential part of the Go project",

+ 		},

+ 		cli.StringSliceFlag{

+ 			Name:  "include-extension, e",

+ 			Usage: "Include all files with the extension in the recognized resources, e.g. .proto, .tmpl",

+ 		},

+ 		cli.BoolFlag{

+ 			Name:  "json",

+ 			Usage: "Output as JSON artefact",

+ 		},

  	}

  

  	app.Action = func(c *cli.Context) error {

Instead of initializing all fields of the *Flag structs, just specify Name and Usage. The rest of the fields can just follow the default zero value.

Fixes #1.

Pull-Request has been merged by qulogic

5 years ago
Metadata