Skip to content

Commit

Permalink
Export default parser
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Nola <derek.nola@suse.com>
(cherry picked from commit 9cc930e)
  • Loading branch information
dereknola authored and brandond committed Dec 23, 2021
1 parent d0f7e23 commit ff49dcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/configfilearg/defaultparser.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/urfave/cli"
)

var defaultParser = &Parser{
var DefaultParser = &Parser{
After: []string{"server", "agent", "etcd-snapshot:1"},
FlagNames: []string{"--config", "-c"},
EnvName: version.ProgramUpper + "_CONFIG_FILE",
Expand All @@ -16,7 +16,7 @@ var defaultParser = &Parser{
}

func MustParse(args []string) []string {
result, err := defaultParser.Parse(args)
result, err := DefaultParser.Parse(args)
if err != nil {
logrus.Fatal(err)
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/configfilearg/defaultparser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func Test_UnitMustParse(t *testing.T) {
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
defaultParser.DefaultConfig = tt.config
DefaultParser.DefaultConfig = tt.config
if got := MustParse(tt.args); !reflect.DeepEqual(got, tt.want) {
t.Errorf("MustParse() = %+v\nWant = %+v", got, tt.want)
}
Expand Down

0 comments on commit ff49dcf

Please sign in to comment.