From 666540b0f09138233423f80c6874af6778f06eb5 Mon Sep 17 00:00:00 2001 From: rsteube Date: Sat, 14 May 2022 12:59:59 +0200 Subject: [PATCH] macro: fix descriptions --- pkg/actions/net/http/http.go | 2 +- pkg/actions/os/sound.go | 2 +- pkg/actions/tools/docker/docker.go | 2 +- pkg/actions/tools/git/bundle.go | 1 + pkg/actions/tools/git/config.go | 8 ++++++++ pkg/actions/tools/git/ls.go | 4 ++-- pkg/actions/tools/git/remote.go | 1 + pkg/actions/tools/git/repositorysearch.go | 2 +- pkg/actions/tools/npm/package.go | 5 +++++ pkg/actions/tools/pacman/pacman.go | 2 +- 10 files changed, 22 insertions(+), 7 deletions(-) diff --git a/pkg/actions/net/http/http.go b/pkg/actions/net/http/http.go index dcaed330e4..8de69cb873 100644 --- a/pkg/actions/net/http/http.go +++ b/pkg/actions/net/http/http.go @@ -6,7 +6,7 @@ import ( "github.com/rsteube/carapace-bin/pkg/actions/os" ) -// ActionRequestHeaders ocmpletes http request headers +// ActionRequestHeaders completes http request headers // Accept:application/json // Accept-Encoding:exi,br func ActionRequestHeaders() carapace.Action { diff --git a/pkg/actions/os/sound.go b/pkg/actions/os/sound.go index bee437fb1e..d73145f0ab 100644 --- a/pkg/actions/os/sound.go +++ b/pkg/actions/os/sound.go @@ -7,7 +7,7 @@ import ( "github.com/rsteube/carapace" ) -// ActionSoundCards completion sound cards +// ActionSoundCards completes sound cards // 0 (HDMI) // PCH (1) func ActionSoundCards() carapace.Action { diff --git a/pkg/actions/tools/docker/docker.go b/pkg/actions/tools/docker/docker.go index 55be995fe7..b84506c0ed 100644 --- a/pkg/actions/tools/docker/docker.go +++ b/pkg/actions/tools/docker/docker.go @@ -126,7 +126,7 @@ func ActionContainerPath() carapace.Action { }) } -// ActionLogDrivers completion log drivers +// ActionLogDrivers completes log drivers // splunk (Writes log messages to splunk using the HTTP Event Collector.) // syslog (Writes logging messages to the syslog facility. The syslog daemon must be run...) func ActionLogDrivers() carapace.Action { diff --git a/pkg/actions/tools/git/bundle.go b/pkg/actions/tools/git/bundle.go index 45e7467205..b7d222c88f 100644 --- a/pkg/actions/tools/git/bundle.go +++ b/pkg/actions/tools/git/bundle.go @@ -6,6 +6,7 @@ import ( "github.com/rsteube/carapace" ) +// ActionBundleHeads completes references in a bundle func ActionBundleHeads(file string) carapace.Action { return carapace.ActionExecCommand("git", "bundle", "list-heads", file)(func(output []byte) carapace.Action { lines := strings.Split(string(output), "\n") diff --git a/pkg/actions/tools/git/config.go b/pkg/actions/tools/git/config.go index a1366a05f2..2b15c96781 100644 --- a/pkg/actions/tools/git/config.go +++ b/pkg/actions/tools/git/config.go @@ -7,6 +7,8 @@ import ( "github.com/rsteube/carapace/pkg/style" ) + +// ActionConfigs completes configs func ActionConfigs() carapace.Action { return carapace.ActionCallback(func(c carapace.Context) carapace.Action { // TODO support different git folder @@ -22,6 +24,8 @@ func ActionConfigs() carapace.Action { }) } + +// ActionColors completes colors func ActionColors() carapace.Action { return carapace.ActionStyledValues( "normal", style.Default, @@ -36,6 +40,7 @@ func ActionColors() carapace.Action { ) } +// ActionTextAttributes completes test attributes func ActionTextAttributes() carapace.Action { return carapace.ActionStyledValues( "bold", style.Bold, @@ -46,6 +51,7 @@ func ActionTextAttributes() carapace.Action { ) } +// ActionColorConfigs completes color config func ActionColorConfigs() carapace.Action { return carapace.ActionMultiParts(" ", func(c carapace.Context) carapace.Action { switch len(c.Parts) { @@ -61,6 +67,7 @@ func ActionColorConfigs() carapace.Action { }) } +// ActionConfigTypes completes config types func ActionConfigTypes() carapace.Action { return carapace.ActionValuesDescribed( "bool", "canonicalize values as either \"true\" or \"false\"", @@ -72,6 +79,7 @@ func ActionConfigTypes() carapace.Action { ) } +// ActionConfigTypeOptions completes options for a config type func ActionConfigTypeOptions(t string) carapace.Action { return carapace.ActionCallback(func(c carapace.Context) carapace.Action { switch t { diff --git a/pkg/actions/tools/git/ls.go b/pkg/actions/tools/git/ls.go index ce87897c44..c2c0546f32 100644 --- a/pkg/actions/tools/git/ls.go +++ b/pkg/actions/tools/git/ls.go @@ -15,7 +15,7 @@ type LsRemoteRefOption struct { Tags bool } -// ActionLsRemoteRefs lists branches and tags for a remote url +// ActionLsRemoteRefs completes branches and tags for a remote url // gh-pages (da4528d0a57ad71417336f0e96fa65ece2fad45a) // master (3fbdef3c6a10094812a15cba8e825898b757dfb3) func ActionLsRemoteRefs(opts LsRemoteRefOption) carapace.Action { @@ -35,7 +35,7 @@ func ActionLsRemoteRefs(opts LsRemoteRefOption) carapace.Action { }) } -// ActionRefFiles lists files of a reference +// ActionRefFiles completes files of a reference // go.mod // pkg/ func ActionRefFiles(ref string) carapace.Action { diff --git a/pkg/actions/tools/git/remote.go b/pkg/actions/tools/git/remote.go index 23cdb55b31..631b4ede55 100644 --- a/pkg/actions/tools/git/remote.go +++ b/pkg/actions/tools/git/remote.go @@ -16,6 +16,7 @@ func ActionRemotes() carapace.Action { }) } +// ActionRemoteUrls completes remote urls func ActionRemoteUrls(remote string) carapace.Action { return carapace.ActionExecCommand("git", "remote", "get-url", remote)(func(output []byte) carapace.Action { lines := strings.Split(string(output), "\n") diff --git a/pkg/actions/tools/git/repositorysearch.go b/pkg/actions/tools/git/repositorysearch.go index 2e4b36a920..1e57d48924 100644 --- a/pkg/actions/tools/git/repositorysearch.go +++ b/pkg/actions/tools/git/repositorysearch.go @@ -9,7 +9,7 @@ import ( "github.com/spf13/cobra" ) -// ActionRepositorySearch completies repositories from github.com and gitlab.com +// ActionRepositorySearch completes repositories from github.com and gitlab.com // https://github.com/spf13/cobra // https://gitlab.com/gitlab-org/gitlab-runner func ActionRepositorySearch() carapace.Action { diff --git a/pkg/actions/tools/npm/package.go b/pkg/actions/tools/npm/package.go index 52683278d2..f1289eca3a 100644 --- a/pkg/actions/tools/npm/package.go +++ b/pkg/actions/tools/npm/package.go @@ -8,6 +8,7 @@ import ( "github.com/rsteube/carapace" ) +// ActionPackageSearch completes packages@version for given registry func ActionPackageSearch(registry string) carapace.Action { return carapace.ActionMultiParts("@", func(c carapace.Context) carapace.Action { switch len(c.Parts) { @@ -21,6 +22,7 @@ func ActionPackageSearch(registry string) carapace.Action { }) } +// ActionPackageNames completes package names for given registry func ActionPackageNames(registry string) carapace.Action { return carapace.ActionCallback(func(c carapace.Context) carapace.Action { args := []string{"search", "--parseable", "--searchlimit", "250", fmt.Sprintf(`/^%v`, c.CallbackValue)} @@ -46,6 +48,7 @@ type PackageOpts struct { Package string } +// ActionPackageVersions completes versions for given package func ActionPackageVersions(opts PackageOpts) carapace.Action { return carapace.ActionCallback(func(c carapace.Context) carapace.Action { args := []string{"view", opts.Package, "versions", "--json"} @@ -63,6 +66,8 @@ func ActionPackageVersions(opts PackageOpts) carapace.Action { }) } + +// ActionPackageTags completes tags for given package func ActionPackageTags(opts PackageOpts) carapace.Action { return carapace.ActionCallback(func(c carapace.Context) carapace.Action { args := []string{"view", opts.Package, "dist-tags", "--json"} diff --git a/pkg/actions/tools/pacman/pacman.go b/pkg/actions/tools/pacman/pacman.go index 6dc8ae83a5..bf9ce22702 100644 --- a/pkg/actions/tools/pacman/pacman.go +++ b/pkg/actions/tools/pacman/pacman.go @@ -9,7 +9,7 @@ import ( "gopkg.in/ini.v1" ) -// ActionRepositories completion package repositories +// ActionRepositories completes package repositories // extra // multilib func ActionRepositories() carapace.Action {