Skip to content

Commit

Permalink
macro: fix descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed May 14, 2022
1 parent 843f833 commit 666540b
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pkg/actions/net/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/os/sound.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/tools/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/actions/tools/git/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
8 changes: 8 additions & 0 deletions pkg/actions/tools/git/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,6 +24,8 @@ func ActionConfigs() carapace.Action {
})
}


// ActionColors completes colors
func ActionColors() carapace.Action {
return carapace.ActionStyledValues(
"normal", style.Default,
Expand All @@ -36,6 +40,7 @@ func ActionColors() carapace.Action {
)
}

// ActionTextAttributes completes test attributes
func ActionTextAttributes() carapace.Action {
return carapace.ActionStyledValues(
"bold", style.Bold,
Expand All @@ -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) {
Expand All @@ -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\"",
Expand All @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions pkg/actions/tools/git/ls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
1 change: 1 addition & 0 deletions pkg/actions/tools/git/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/tools/git/repositorysearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
5 changes: 5 additions & 0 deletions pkg/actions/tools/npm/package.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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)}
Expand All @@ -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"}
Expand All @@ -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"}
Expand Down
2 changes: 1 addition & 1 deletion pkg/actions/tools/pacman/pacman.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"gopkg.in/ini.v1"
)

// ActionRepositories completion package repositories
// ActionRepositories completes package repositories
// extra
// multilib
func ActionRepositories() carapace.Action {
Expand Down

0 comments on commit 666540b

Please sign in to comment.