Skip to content

Commit

Permalink
chore(config): add default_hostname
Browse files Browse the repository at this point in the history
  • Loading branch information
pinglin committed Oct 13, 2023
1 parent 9cd6041 commit 5a58530
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
14 changes: 14 additions & 0 deletions internal/config/config_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ var configOptions = []ConfigOption{
Description: "the web browser to use for opening URLs",
DefaultValue: "",
},
{
Key: "default_hostname",
Description: "the default hostname to use for commands that require a hostname",
DefaultValue: "",
},
}

func ConfigOptions() []ConfigOption {
Expand Down Expand Up @@ -190,6 +195,15 @@ func NewBlankRoot() *yaml.Node {
Kind: yaml.ScalarNode,
Value: "",
},
{
HeadComment: "The default hostname to use for commands that require a hostname, e.g. inst instance list.",
Kind: yaml.ScalarNode,
Value: "default_hostname",
},
{
Kind: yaml.ScalarNode,
Value: "",
},
},
},
},
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config_type_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ func Test_defaultConfig(t *testing.T) {
http_unix_socket:
# What web browser inst should use when opening URLs. If blank, will refer to environment.
browser:
# The default hostname to use for commands that require a hostname, e.g. inst instance list.
default_hostname:
`)
assert.Equal(t, expected, mainBuf.String())
assert.Equal(t, "", hostsBuf.String())
Expand Down

0 comments on commit 5a58530

Please sign in to comment.