Skip to content

Commit

Permalink
fix(app): add ArgsUsage (#508)
Browse files Browse the repository at this point in the history
  • Loading branch information
knqyf263 authored Jun 2, 2020
1 parent 2f2d1a9 commit 020c4a3
Showing 1 changed file with 22 additions and 18 deletions.
40 changes: 22 additions & 18 deletions internal/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ func NewApp(version string) *cli.App {
app := cli.NewApp()
app.Name = "trivy"
app.Version = version
app.ArgsUsage = "image_name"
app.ArgsUsage = "target"
app.Usage = "A simple and comprehensive vulnerability scanner for containers"
app.EnableBashCompletion = true

Expand Down Expand Up @@ -319,20 +319,22 @@ func showVersion(cacheDir, outputFormat, version string, outputWriter io.Writer)

func NewImageCommand() *cli.Command {
return &cli.Command{
Name: "image",
Aliases: []string{"i"},
Usage: "scan an image",
Action: artifact.ImageRun,
Flags: imageFlags,
Name: "image",
Aliases: []string{"i"},
ArgsUsage: "image_name",
Usage: "scan an image",
Action: artifact.ImageRun,
Flags: imageFlags,
}
}

func NewFilesystemCommand() *cli.Command {
return &cli.Command{
Name: "filesystem",
Aliases: []string{"fs"},
Usage: "scan local filesystem",
Action: artifact.FilesystemRun,
Name: "filesystem",
Aliases: []string{"fs"},
ArgsUsage: "dir",
Usage: "scan local filesystem",
Action: artifact.FilesystemRun,
Flags: []cli.Flag{
&templateFlag,
&formatFlag,
Expand All @@ -356,10 +358,11 @@ func NewFilesystemCommand() *cli.Command {

func NewRepositoryCommand() *cli.Command {
return &cli.Command{
Name: "repository",
Aliases: []string{"repo"},
Usage: "scan remote repository",
Action: artifact.RepositoryRun,
Name: "repository",
Aliases: []string{"repo"},
ArgsUsage: "repo_url",
Usage: "scan remote repository",
Action: artifact.RepositoryRun,
Flags: []cli.Flag{
&templateFlag,
&formatFlag,
Expand All @@ -383,10 +386,11 @@ func NewRepositoryCommand() *cli.Command {

func NewClientCommand() *cli.Command {
return &cli.Command{
Name: "client",
Aliases: []string{"c"},
Usage: "client mode",
Action: client.Run,
Name: "client",
Aliases: []string{"c"},
ArgsUsage: "image_name",
Usage: "client mode",
Action: client.Run,
Flags: []cli.Flag{
&templateFlag,
&formatFlag,
Expand Down

0 comments on commit 020c4a3

Please sign in to comment.