Skip to content

Commit

Permalink
added fury
Browse files Browse the repository at this point in the history
  • Loading branch information
rsteube committed Feb 15, 2024
1 parent de26845 commit 4114908
Show file tree
Hide file tree
Showing 29 changed files with 601 additions and 0 deletions.
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/accounts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var accountsCmd = &cobra.Command{
Use: "accounts",
Short: "Listing of your collaborations",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(accountsCmd)
}
19 changes: 19 additions & 0 deletions completers/fury_completer/cmd/beta.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

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

var betaCmd = &cobra.Command{
Use: "beta",
Short: "Experimental features",
Hidden: true,
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(betaCmd)
}
25 changes: 25 additions & 0 deletions completers/fury_completer/cmd/beta_backup.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package cmd

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

var beta_backupCmd = &cobra.Command{
Use: "backup DIR",
Short: "Save all files to a directory",
Run: func(cmd *cobra.Command, args []string) {},
}

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

beta_backupCmd.Flags().String("kind", "", "Filter to one kind of package")
betaCmd.AddCommand(beta_backupCmd)

// TODO kind

carapace.Gen(betaCmd).PositionalCompletion(
carapace.ActionDirectories(),
)
}
30 changes: 30 additions & 0 deletions completers/fury_completer/cmd/beta_download.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package cmd

import (
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/pkg/actions/tools/fury"
"github.com/spf13/cobra"
)

var beta_downloadCmd = &cobra.Command{
Use: "download PACKAGE@VERSION",
Short: "Download a package to the current directory",
Run: func(cmd *cobra.Command, args []string) {},
}

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

betaCmd.AddCommand(beta_downloadCmd)

carapace.Gen(betaCmd).PositionalCompletion(
carapace.ActionMultiPartsN("@", 2, func(c carapace.Context) carapace.Action {
switch len(c.Parts) {
case 0:
return fury.ActionPackages().Suffix("@").MultiParts(":")
default:
return fury.ActionPackageVersions(c.Parts[0])
}
}),
)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var gitCmd = &cobra.Command{
Use: "git",
Short: "Git repository commands",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(gitCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_configCmd = &cobra.Command{
Use: "config REPO",
Short: "Configure Git build",
Run: func(cmd *cobra.Command, args []string) {},
}

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

gitCmd.AddCommand(git_configCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_config_get.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_config_getCmd = &cobra.Command{
Use: "get REPO KEY",
Short: "Get Git build environment key",
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_configCmd.AddCommand(git_config_getCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_config_set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_config_setCmd = &cobra.Command{
Use: "set REPO KEY=VAL",
Short: "Set Git build environment key",
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_configCmd.AddCommand(git_config_setCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_config_unset.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_config_unsetCmd = &cobra.Command{
Use: "unset REPO KEY",
Short: "Remove Git build environment key",
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_configCmd.AddCommand(git_config_unsetCmd)
}
20 changes: 20 additions & 0 deletions completers/fury_completer/cmd/git_destroy.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 git_destroyCmd = &cobra.Command{
Use: "destroy REPO",
Short: "Remove Git repository",
Aliases: []string{"reset"},
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_destroyCmd.Flags().Bool("reset-only", false, "Reset repo without destroying")
gitCmd.AddCommand(git_destroyCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_list.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_listCmd = &cobra.Command{
Use: "list",
Short: "List repos in this account",
Run: func(cmd *cobra.Command, args []string) {},
}

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

gitCmd.AddCommand(git_listCmd)
}
19 changes: 19 additions & 0 deletions completers/fury_completer/cmd/git_rebuild.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

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

var git_rebuildCmd = &cobra.Command{
Use: "rebuild REPO",
Short: "Run the builder on the repo",
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_rebuildCmd.Flags().StringP("revision", "r", "", "Revision")
gitCmd.AddCommand(git_rebuildCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_rename.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_renameCmd = &cobra.Command{
Use: "rename REPO NEWNAME",
Short: "Rename a Git repository",
Run: func(cmd *cobra.Command, args []string) {},
}

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

gitCmd.AddCommand(git_renameCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_stack.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_stackCmd = &cobra.Command{
Use: "stack REPO",
Short: "Configure Git stack",
Run: func(cmd *cobra.Command, args []string) {},
}

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

gitCmd.AddCommand(git_stackCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/git_stack_set.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var git_stack_setCmd = &cobra.Command{
Use: "set REPO STACK",
Short: "Set Git stack for repo",
Run: func(cmd *cobra.Command, args []string) {},
}

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

git_stackCmd.AddCommand(git_stack_setCmd)
}
22 changes: 22 additions & 0 deletions completers/fury_completer/cmd/help.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 helpCmd = &cobra.Command{
Use: "help [command]",
Short: "Help about any command",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(helpCmd)

carapace.Gen(helpCmd).PositionalAnyCompletion(
carapace.ActionCommands(helpCmd),
)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/login.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var loginCmd = &cobra.Command{
Use: "login",
Short: "Authenticate into Gemfury account",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(loginCmd)
}
18 changes: 18 additions & 0 deletions completers/fury_completer/cmd/logout.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
package cmd

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

var logoutCmd = &cobra.Command{
Use: "logout",
Short: "Clear CLI session credentials",
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(logoutCmd)
}
19 changes: 19 additions & 0 deletions completers/fury_completer/cmd/packages.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package cmd

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

var packagesCmd = &cobra.Command{
Use: "packages",
Short: "List packages in this account",
Aliases: []string{"list"},
Run: func(cmd *cobra.Command, args []string) {},
}

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

rootCmd.AddCommand(packagesCmd)
}
Loading

0 comments on commit 4114908

Please sign in to comment.