Skip to content

Commit

Permalink
set maximum n args
Browse files Browse the repository at this point in the history
  • Loading branch information
koki-develop committed Mar 19, 2023
1 parent 365df28 commit 03f33cf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ var (
var rootCmd = &cobra.Command{
Use: "typingo",
Short: "Typing game written in Go",
Args: cobra.MaximumNArgs(0),
RunE: func(cmd *cobra.Command, args []string) error {
if numTexts < 1 {
return errors.New(`invalid argument %d for "-n, --num-texts" flag: must be at least 1`)
Expand Down

0 comments on commit 03f33cf

Please sign in to comment.