-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy patherrors.go
38 lines (27 loc) · 1.38 KB
/
errors.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package fisk
import (
"errors"
"fmt"
)
var (
// ErrUnknownLongFlag indicates an unknown long form flag was passed
ErrUnknownLongFlag = errors.New("unknown long flag")
// ErrUnknownShortFlag indicates an unknown short form flag was passed
ErrUnknownShortFlag = errors.New("unknown short flag")
// ErrExpectedFlagArgument indicates a flag requiring an argument did not have one supplied
ErrExpectedFlagArgument = errors.New("expected argument for flag")
// ErrCommandNotSpecified indicates a command was expected
ErrCommandNotSpecified = fmt.Errorf("command not specified")
// ErrSubCommandRequired indicates that a command was invoked, but it required a sub command
ErrSubCommandRequired = errors.New("must select a subcommand")
// ErrRequiredArgument indicates a required argument was not given
ErrRequiredArgument = errors.New("required argument")
// ErrRequiredFlag indicates a required flag was not given
ErrRequiredFlag = errors.New("required flag")
// ErrExpectedKnownCommand indicates that an unknown command argument was encountered
ErrExpectedKnownCommand = errors.New("expected command")
// ErrFlagCannotRepeat indicates a flag cannot be passed multiple times to fill an array
ErrFlagCannotRepeat = errors.New("cannot be repeated")
// ErrUnexpectedArgument indicates an unexpected argument was encountered
ErrUnexpectedArgument = errors.New("unexpected argument")
)