Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh: updates from v2.28 #1675

Merged
merged 1 commit into from
Apr 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions completers/gh_completer/cmd/codespace_create.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ func init() {
codespace_createCmd.Flags().StringP("repo-deprecated", "r", "", "(Deprecated) Shorthand for --repo")
codespace_createCmd.Flags().Duration("retention-period", 0, "allowed time after shutting down before the codespace is automatically deleted (maximum 30 days), e.g. \"1h\", \"72h\"")
codespace_createCmd.Flags().BoolP("status", "s", false, "show status of post-create command and dotfiles")
codespace_createCmd.Flags().BoolP("web", "w", false, "create codespace from browser, cannot be used with --display-name, --idle-timeout, or --retention-period")
codespaceCmd.AddCommand(codespace_createCmd)

// TODO devcontainer-path
Expand Down
1 change: 1 addition & 0 deletions completers/gh_completer/cmd/codespace_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ func init() {
codespace_listCmd.Flags().StringP("repo-deprecated", "r", "", "(Deprecated) Shorthand for --repo")
codespace_listCmd.Flags().StringP("template", "t", "", "Format JSON output using a Go template; see \"gh help formatting\"")
codespace_listCmd.Flags().StringP("user", "u", "", "The `username` to list codespaces for (used with --org)")
codespace_listCmd.Flags().BoolP("web", "w", false, "List codespaces in the web browser, cannot be used with --user or --org")
codespaceCmd.AddCommand(codespace_listCmd)

carapace.Gen(codespace_listCmd).FlagCompletion(carapace.ActionMap{
Expand Down
2 changes: 1 addition & 1 deletion completers/gh_completer/cmd/extension_search.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func init() {
extension_searchCmd.Flags().StringSlice("license", []string{}, "Filter based on license type")
extension_searchCmd.Flags().IntP("limit", "L", 30, "Maximum number of extensions to fetch")
extension_searchCmd.Flags().String("order", "desc", "Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc}")
extension_searchCmd.Flags().String("owner", "", "Filter on owner")
extension_searchCmd.Flags().StringSlice("owner", []string{}, "Filter on owner")
extension_searchCmd.Flags().String("sort", "best-match", "Sort fetched repositories: {forks|help-wanted-issues|stars|updated}")
extension_searchCmd.Flags().StringP("template", "t", "", "Format JSON output using a Go template; see \"gh help formatting\"")
extension_searchCmd.Flags().BoolP("web", "w", false, "Open the search query in the web browser")
Expand Down
22 changes: 22 additions & 0 deletions completers/gh_completer/cmd/org.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var orgCmd = &cobra.Command{
Use: "org <command>",
Short: "Manage organizations",
GroupID: "core",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(orgCmd).Standalone()
orgCmd.AddGroup(
&cobra.Group{ID: "General commands", Title: "General commands"},
)

rootCmd.AddCommand(orgCmd)
}
20 changes: 20 additions & 0 deletions completers/gh_completer/cmd/org_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/spf13/cobra"
)

var org_listCmd = &cobra.Command{
Use: "list",
Short: "List organizations for the authenticated user.",
GroupID: "General commands",
Run: func(cmd *cobra.Command, args []string) {},
}

func init() {
carapace.Gen(org_listCmd).Standalone()

org_listCmd.Flags().IntP("limit", "L", 30, "Maximum number of organizations to list")
orgCmd.AddCommand(org_listCmd)
}
2 changes: 1 addition & 1 deletion completers/gh_completer/cmd/search_commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {
search_commitsCmd.Flags().IntP("limit", "L", 30, "Maximum number of commits to fetch")
search_commitsCmd.Flags().Bool("merge", false, "Filter on merge commits")
search_commitsCmd.Flags().String("order", "desc", "Order of commits returned, ignored unless '--sort' flag is specified: {asc|desc}")
search_commitsCmd.Flags().String("owner", "", "Filter on repository owner")
search_commitsCmd.Flags().StringSlice("owner", []string{}, "Filter on repository owner")
search_commitsCmd.Flags().String("parent", "", "Filter by parent hash")
search_commitsCmd.Flags().StringSliceP("repo", "R", []string{}, "Filter on repository")
search_commitsCmd.Flags().String("sort", "best-match", "Sort fetched commits: {author-date|committer-date}")
Expand Down
2 changes: 1 addition & 1 deletion completers/gh_completer/cmd/search_issues.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func init() {
search_issuesCmd.Flags().Bool("no-milestone", false, "Filter on missing milestone")
search_issuesCmd.Flags().Bool("no-project", false, "Filter on missing project")
search_issuesCmd.Flags().String("order", "desc", "Order of results returned, ignored unless '--sort' flag is specified: {asc|desc}")
search_issuesCmd.Flags().String("owner", "", "Filter on repository owner")
search_issuesCmd.Flags().StringSlice("owner", []string{}, "Filter on repository owner")
search_issuesCmd.Flags().String("project", "", "Filter on project board `number`")
search_issuesCmd.Flags().String("reactions", "", "Filter on `number` of reactions")
search_issuesCmd.Flags().StringSliceP("repo", "R", []string{}, "Filter on repository")
Expand Down
2 changes: 1 addition & 1 deletion completers/gh_completer/cmd/search_prs.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func init() {
search_prsCmd.Flags().Bool("no-milestone", false, "Filter on missing milestone")
search_prsCmd.Flags().Bool("no-project", false, "Filter on missing project")
search_prsCmd.Flags().String("order", "desc", "Order of results returned, ignored unless '--sort' flag is specified: {asc|desc}")
search_prsCmd.Flags().String("owner", "", "Filter on repository owner")
search_prsCmd.Flags().StringSlice("owner", []string{}, "Filter on repository owner")
search_prsCmd.Flags().String("project", "", "Filter on project board `number`")
search_prsCmd.Flags().String("reactions", "", "Filter on `number` of reactions")
search_prsCmd.Flags().StringSliceP("repo", "R", []string{}, "Filter on repository")
Expand Down
2 changes: 1 addition & 1 deletion completers/gh_completer/cmd/search_repos.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func init() {
search_reposCmd.Flags().StringSlice("match", []string{}, "Restrict search to specific field of repository: {name|description|readme}")
search_reposCmd.Flags().String("number-topics", "", "Filter on `number` of topics")
search_reposCmd.Flags().String("order", "desc", "Order of repositories returned, ignored unless '--sort' flag is specified: {asc|desc}")
search_reposCmd.Flags().String("owner", "", "Filter on owner")
search_reposCmd.Flags().StringSlice("owner", []string{}, "Filter on owner")
search_reposCmd.Flags().String("size", "", "Filter on a size range, in kilobytes")
search_reposCmd.Flags().String("sort", "best-match", "Sort fetched repositories: {forks|help-wanted-issues|stars|updated}")
search_reposCmd.Flags().String("stars", "", "Filter on `number` of stars")
Expand Down
5 changes: 5 additions & 0 deletions completers/gh_completer/cmd/sshKey_add.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,13 @@ func init() {
carapace.Gen(sshKey_addCmd).Standalone()

sshKey_addCmd.Flags().StringP("title", "t", "", "Title for the new key")
sshKey_addCmd.Flags().String("type", "authentication", "Type of the ssh key: {authentication|signing}")
sshKeyCmd.AddCommand(sshKey_addCmd)

carapace.Gen(sshKey_addCmd).FlagCompletion(carapace.ActionMap{
"type": carapace.ActionValues("authentication", "signing"),
})

carapace.Gen(sshKey_addCmd).PositionalCompletion(
carapace.ActionFiles(),
)
Expand Down