-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Show help when running
ldcli config
(#186)
Show help when running `ldcli config`
- Loading branch information
Showing
3 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package config_test | ||
|
||
import ( | ||
"ldcli/cmd" | ||
"os" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestNoFlag(t *testing.T) { | ||
expected, err := os.ReadFile("testdata/help.golden") | ||
require.NoError(t, err) | ||
args := []string{ | ||
"config", | ||
} | ||
|
||
output, err := cmd.CallCmd(t, nil, nil, nil, nil, args) | ||
|
||
require.NoError(t, err) | ||
|
||
assert.Equal(t, string(expected), string(output)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
View and modify specific configuration values | ||
|
||
Usage: | ||
ldcli config [flags] | ||
|
||
Flags: | ||
-h, --help help for config | ||
--list List configs | ||
--set Set a config field to a value | ||
--unset string Unset a config field | ||
|
||
Global Flags: | ||
--access-token string LaunchDarkly API token with write-level access | ||
--base-uri string LaunchDarkly base URI (default "https://app.launchdarkly.com") |