Adds the token structure
This commit is contained in:
parent
c291c97cb2
commit
ae13697461
2 changed files with 58 additions and 4 deletions
12
cmd/root.go
12
cmd/root.go
|
@ -7,13 +7,21 @@ import (
|
|||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var RootCmd = &cobra.Command{
|
||||
func RootCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "campaigner",
|
||||
Short: "Create and manage Open Source campaigns",
|
||||
}
|
||||
|
||||
cmd.AddCommand(
|
||||
TokenCmd(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
func Execute() {
|
||||
if err := RootCmd.Execute(); err != nil {
|
||||
if err := RootCmd().Execute(); err != nil {
|
||||
fmt.Fprintln(os.Stderr, err)
|
||||
}
|
||||
}
|
||||
|
|
46
cmd/token.go
Normal file
46
cmd/token.go
Normal file
|
@ -0,0 +1,46 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func TokenSetJiraCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "jira",
|
||||
Short: "Sets the value of the jira token",
|
||||
}
|
||||
}
|
||||
|
||||
func TokenSetGithubCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "github",
|
||||
Short: "Sets the value of the github token",
|
||||
}
|
||||
}
|
||||
|
||||
func TokenSetCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "set",
|
||||
Short: "Sets the value of the platform tokens",
|
||||
}
|
||||
|
||||
cmd.AddCommand(
|
||||
TokenSetJiraCmd(),
|
||||
TokenSetGithubCmd(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
||||
|
||||
func TokenCmd() *cobra.Command {
|
||||
cmd := &cobra.Command{
|
||||
Use: "token",
|
||||
Short: "Subcommands related to tokens",
|
||||
}
|
||||
|
||||
cmd.AddCommand(
|
||||
TokenSetCmd(),
|
||||
)
|
||||
|
||||
return cmd
|
||||
}
|
Loading…
Reference in a new issue