Skip to content

Commit 0e5370c

Browse files
committed
gh: added tags
1 parent 4eea7cb commit 0e5370c

File tree

19 files changed

+27
-28
lines changed

19 files changed

+27
-28
lines changed

completers/common/gh_completer/cmd/action/action.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ func ActionConfigHosts() carapace.Action {
2323
return carapace.ActionMessage("failed to parse DefaultConfig: " + err.Error())
2424
} else {
2525
if hosts, err := config.Hosts(); err != nil {
26-
return carapace.ActionMessage("failed ot loadd hosts: " + err.Error())
26+
return carapace.ActionMessage("failed ot load hosts: " + err.Error())
2727
} else {
2828
return carapace.ActionValues(hosts...)
2929
}
3030
}
31-
})
31+
}).Tag("config hosts")
3232
}
3333

3434
func ApiV3Action(cmd *cobra.Command, query string, v interface{}, transform func() carapace.Action) carapace.Action {

completers/common/gh_completer/cmd/action/alias.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package action
22

33
import (
44
"errors"
5+
"maps"
56

67
"github.com/carapace-sh/carapace"
78
"github.com/carapace-sh/carapace-bin/completers/common/gh_completer/cmd/action/config"
@@ -15,9 +16,7 @@ func Aliases() (map[string]string, error) {
1516
return nil, errors.New("failed to load AliasCfg:" + err.Error())
1617
} else {
1718
aliases := make(map[string]string)
18-
for key, value := range aliasCfg.All() {
19-
aliases[key] = value
20-
}
19+
maps.Copy(aliases, aliasCfg.All())
2120
return aliases, nil
2221
}
2322
}
@@ -34,5 +33,5 @@ func ActionAliases() carapace.Action {
3433
}
3534
return carapace.ActionValuesDescribed(values...)
3635
}
37-
})
36+
}).Tag("aliases")
3837
}

completers/common/gh_completer/cmd/action/api.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ func ActionApiPreviews() carapace.Action {
3434
"switcheroo", "Enable and disable Pages",
3535
"x-ray", "Anonymous Git access to repositories",
3636
"zzzax", "Require signed commits",
37-
)
37+
).Tag("api previews")
3838
}
3939

4040
func ActionApiV3Paths(cmd *cobra.Command) carapace.Action {
@@ -123,5 +123,6 @@ func fakeRepoFlag(cmd *cobra.Command, owner, repo string) {
123123
}
124124

125125
func ActionPackageTypes() carapace.Action {
126-
return carapace.ActionValues("npm", "maven", "rubygems", "nuget", "docker", "container")
126+
return carapace.ActionValues("npm", "maven", "rubygems", "nuget", "docker", "container").
127+
Tag("package types")
127128
}

completers/common/gh_completer/cmd/action/artifacts.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func ActionWorkflowArtifactNames(cmd *cobra.Command, runId string) carapace.Acti
3838
}
3939
return carapace.ActionValuesDescribed(vals...)
4040
})
41-
})
41+
}).Tag("artifact names")
4242
}
4343

4444
func ActionWorkflowArtifactIds(cmd *cobra.Command, runId string) carapace.Action {
@@ -61,5 +61,5 @@ func ActionWorkflowArtifactIds(cmd *cobra.Command, runId string) carapace.Action
6161
}
6262
return carapace.ActionValuesDescribed(vals...)
6363
})
64-
})
64+
}).Tag("artifact ids")
6565
}

completers/common/gh_completer/cmd/action/branch.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func ActionBranches(cmd *cobra.Command) carapace.Action {
3535
}
3636
return carapace.ActionValuesDescribed(vals...).Style(styles.Git.Branch)
3737
})
38-
})
38+
}).Tag("branches")
3939
}
4040

4141
type commitRef struct {
@@ -81,5 +81,5 @@ func ActionBranchCommits(cmd *cobra.Command, branch string) carapace.Action {
8181
}
8282
return carapace.ActionValuesDescribed(vals...).Style(styles.Git.Branch)
8383
})
84-
})
84+
}).Tag("branch commits")
8585
}

completers/common/gh_completer/cmd/action/coc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ func ActionCocs(cmd *cobra.Command) carapace.Action {
2020
}
2121
return carapace.ActionValuesDescribed(vals...)
2222
})
23-
})
23+
}).Tag("code of conducts")
2424
}

completers/common/gh_completer/cmd/action/codespace.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func ActionCodespaces() carapace.Action {
2929
vals = append(vals, c.Name, fmt.Sprintf("%v - %v - %v", c.Owner, c.Repository, c.State))
3030
}
3131
return carapace.ActionValuesDescribed(vals...)
32-
})
32+
}).Tag("codespaces")
3333
}
3434

3535
func ActionCodespacePath(codespace string, expand bool) carapace.Action {
@@ -43,7 +43,7 @@ func ActionCodespacePath(codespace string, expand bool) carapace.Action {
4343
// security risk (see https://lwn.net/Articles/835962/), we
4444
// disable them by shell-escaping the argument unless the user
4545
// provided the -e flag.
46-
path = `'` + strings.Replace(path, `'`, `'\''`, -1) + `'`
46+
path = `'` + strings.ReplaceAll(path, `'`, `'\''`) + `'`
4747
}
4848

4949
args := []string{"codespace", "ssh", "--codespace", codespace, "--", "ls", "-1", "-p", path}

completers/common/gh_completer/cmd/action/discussion.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ func ActionDiscussionCategories(cmd *cobra.Command) carapace.Action {
3232
}
3333
return carapace.ActionValuesDescribed(vals...)
3434
})
35-
})
35+
}).Tag("discussion categories")
3636
}

completers/common/gh_completer/cmd/action/environment.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ func ActionEnvironments(cmd *cobra.Command) carapace.Action {
3535
}
3636
return carapace.ActionValuesDescribed(vals...)
3737
})
38-
})
38+
}).Tag("environments")
3939
}

completers/common/gh_completer/cmd/action/extension.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func ActionExtensions() carapace.Action {
6262
return carapace.ActionMessage(err.Error())
6363
}
6464
return carapace.ActionValues(extensions...)
65-
})
65+
}).Tag("extensions")
6666
}
6767

6868
func ActionTopExtensions() carapace.Action {

0 commit comments

Comments
 (0)