You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package main
import"github.com/integrii/flaggy"funcmain() {
// Declare variables and their defaultsvarstringFlag="defaultValue"// Create the subcommandsubcommand:=flaggy.NewSubcommand("subcommandExample")
// Add a flag to the subcommandsubcommand.String(&stringFlag, "f", "flag", "A test string flag")
// Add the subcommand to the parser at position 1flaggy.AttachSubcommand(subcommand, 1)
// Parse the subcommand and all flagsflaggy.Parse()
// Use the flagprintln(stringFlag)
}
when calling this by % ./main -f a, it shows the following error:
mymain
Usage:
mymain [subcommandExample]
Subcommands:
subcommandExample
Flags:
--version Displays the program version string.
-h --help Displays help with available flag, subcommand, and positional value parameters.
Unknown arguments supplied: f a
so, is there any option to show the error as Unknown arguments supplied: -f a instead of Unknown arguments supplied: f a? I.e, replacing the empty space before f by the - symbol.
Edit: the same for Expected a following arg for flag f, but it did not exist, it would be nice an option to show Expected a following arg for flag -f, but it did not exist instead, and Expected a following arg for flag --flag, but it did not exist instead of Expected a following arg for flag flag, but it did not exist, and so on.
TIA
The text was updated successfully, but these errors were encountered:
Hi.
Consider the following example:
when calling this by
% ./main -f a
, it shows the following error:so, is there any option to show the error as
Unknown arguments supplied: -f a
instead ofUnknown arguments supplied: f a
? I.e, replacing the empty space beforef
by the-
symbol.Edit: the same for
Expected a following arg for flag f, but it did not exist
, it would be nice an option to showExpected a following arg for flag -f, but it did not exist
instead, andExpected a following arg for flag --flag, but it did not exist
instead ofExpected a following arg for flag flag, but it did not exist
, and so on.TIA
The text was updated successfully, but these errors were encountered: