mirror of
https://gitea.com/gitea/tea.git
synced 2026-10-26 11:01:25 +01:00
fix: keep the command word after a leading --json
Signed-off-by: bircni <bircni@icloud.com>
This commit is contained in:
2 files changed
+7
No files matched your search
@@ -98,6 +98,9 @@ func TestJoinJSONFields(t *testing.T) {
|
||||
{[]string{"search", "issue", "--json", "bug"}, []string{"search", "issue", "--json", "bug"}},
|
||||
{[]string{"repo", "clone", "--json", "project"}, []string{"repo", "clone", "--json", "project"}},
|
||||
{[]string{"search", "repo", "--json", "name,url", "tea"}, []string{"search", "repo", "--json=name,url", "tea"}},
|
||||
// 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{"--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"}},
|
||||
|
||||
Reference in new issue
Block a user