Skip to content

Commit

Permalink
chore: update CLI usages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bobgy committed Mar 12, 2022
1 parent 75f352b commit c84fde2
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
8 changes: 5 additions & 3 deletions check.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,11 @@ import (
)

var (
checkCmd = &cobra.Command{
Use: "check <package>",
Short: "Checks whether licenses for a package are not Forbidden.",
checkHelp = "Checks whether licenses for a package are not Forbidden."
checkCmd = &cobra.Command{
Use: "check <package> [package...]",
Short: checkHelp,
Long: checkHelp + packageHelp,
Args: cobra.MinimumNArgs(1),
RunE: checkMain,
}
Expand Down
8 changes: 5 additions & 3 deletions csv.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,11 @@ import (
)

var (
csvCmd = &cobra.Command{
Use: "csv <package>",
Short: "Prints all licenses that apply to a Go package and its dependencies",
csvHelp = "Prints all licenses that apply to one or more Go packages and their dependencies."
csvCmd = &cobra.Command{
Use: "csv <package> [package...]",
Short: csvHelp,
Long: csvHelp + packageHelp,
Args: cobra.MinimumNArgs(1),
RunE: csvMain,
}
Expand Down
17 changes: 16 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,26 @@ import (

var (
rootCmd = &cobra.Command{
Use: "licenses",
Use: "go-licenses",
Short: "go-licenses helps you work with licenses of your go project's dependencies.",
Long: `go-licenses helps you work with licenses of your go project's dependencies.
Prerequisites:
1. Go v1.16 or later.
2. Change directory to your go project.
3. Run "go mod download".`,
}

// Flags shared between subcommands
confidenceThreshold float64
packageHelp = `
Typically, specify the Go package that builds your Go binary.
go-licenses expects the same package argument format as "go build".
For example:
* A rooted import path like "github.com/google/go-licenses" or "github.com/google/go-licenses/licenses".
* A relative path that denotes the package in that directory, like "." or "./cmd/some-command".
To learn more about Go package argument, run "go help packages".`
)

func init() {
Expand Down
8 changes: 5 additions & 3 deletions save.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ import (
)

var (
saveCmd = &cobra.Command{
Use: "save <package>",
Short: "Saves licenses, copyright notices and source code, as required by a Go package's dependencies, to a directory.",
saveHelp = "Saves licenses, copyright notices and source code, as required by a Go package's dependencies, to a directory."
saveCmd = &cobra.Command{
Use: "save <package> [package...]",
Short: saveHelp,
Long: saveHelp + packageHelp,
Args: cobra.MinimumNArgs(1),
RunE: saveMain,
}
Expand Down

0 comments on commit c84fde2

Please sign in to comment.