Skip to content

Commit

Permalink
add URL URI
Browse files Browse the repository at this point in the history
  • Loading branch information
guonaihong committed May 26, 2024
1 parent ba58e71 commit ba7a9fd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion env_short_long_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ var specialNames = map[string]bool{
"JSON": true,
"XML": true,
"YAML": true,
// Add more special names here
"URL": true,
"URI": true,
}

func wordStart(b byte) bool {
Expand Down
4 changes: 4 additions & 0 deletions env_short_long_name_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ func Test_ShortLongName(t *testing.T) {
{"_almost_all", "almost-all"},
{"LongOpt_all", "long-opt-all"},
{"JSON", "JSON"},
{"URL", "URL"},
{"URI", "URI"},
} {
got, err := gnuOptionName(tcase.in)
assert.NoError(t, err)
Expand All @@ -34,6 +36,8 @@ func Test_EnvName(t *testing.T) {
{"_almost_all", "ALMOST_ALL"},
{"envOpt_all", "ENV_OPT_ALL"},
{"JSON", "JSON"},
{"URL", "URL"},
{"URI", "URI"},
} {
got, err := envOptionName(tcase.in)
assert.NoError(t, err)
Expand Down

0 comments on commit ba7a9fd

Please sign in to comment.