fix: address verified review findings (cli-core-1)

Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
bircni committed 2026-10-18 17:38:52 +02:00
1 parent a47dbc413c
commit e15ea907be
12 files changed
+181 -21

No files matched your search

+9
View File
@@ -84,6 +84,14 @@ func TestAliasesAfterGlobalFlagsAndNestedHelp(t *testing.T) {
}
}
func TestBareJSONBeforeAnAliasKeepsTheAlias(t *testing.T) {
deps, out, _ := testDeps(t)
require.NoError(t, Execute(context.Background(), deps, []string{"alias", "set", "prefs", "config list"}))
out.Reset()
require.NoError(t, Execute(context.Background(), deps, []string{"--json", "prefs"}))
require.Contains(t, out.String(), "git_protocol")
}
func TestJoinJSONFields(t *testing.T) {
for _, tc := range []struct{ args, want []string }{
{[]string{"issue", "list", "--json", "number,title"}, []string{"issue", "list", "--json=number,title"}},
@@ -101,6 +109,7 @@ func TestJoinJSONFields(t *testing.T) {
// A leading --json keeps the command word that follows it.
{[]string{"--json", "repo", "view", "alice/project"}, []string{"--json", "repo", "view", "alice/project"}},
{[]string{"--json", "pr", "list"}, []string{"--json", "pr", "list"}},
{[]string{"issue", "--json", "list"}, []string{"issue", "--json", "list"}},
{[]string{"--json", "number", "my-alias"}, []string{"--json=number", "my-alias"}},
// A word that cannot be an argument is a misspelled field, which then lists the available ones.
{[]string{"issue", "list", "--json", "Number"}, []string{"issue", "list", "--json=Number"}},