Skip to content

Commit

Permalink
fix: handle invalid arguments to ls-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
jdkato committed Mar 25, 2022
1 parent acd99f0 commit bbca068
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/cli/command.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ func printConfig(args []string, cfg *core.Config) error {
func printMetrics(args []string, cfg *core.Config) error {
if len(args) != 1 {
return core.NewE100("ls-metrics", errors.New("one argument expected"))
} else if !core.FileExists(args[0]) {
return errors.New("file not found")
}

linter, err := lint.NewLinter(cfg)
Expand Down

0 comments on commit bbca068

Please sign in to comment.