Skip to content

Commit

Permalink
🍉 add command category
Browse files Browse the repository at this point in the history
  • Loading branch information
KeisukeYamashita committed Oct 9, 2019
1 parent eef0f41 commit f30d178
Show file tree
Hide file tree
Showing 12 changed files with 52 additions and 32 deletions.
7 changes: 4 additions & 3 deletions cli/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const (

func newAWSCmd() cli.Command {
return cli.Command{
Name: "aws",
Usage: "Open AWS resource",
Flags: []cli.Flag{},
Name: "aws",
Usage: "Open AWS resource",
Category: categoryCloudProvider,
Flags: []cli.Flag{},
Action: func(c *cli.Context) error {
aws, err := aws.GetProvider()
if err != nil {
Expand Down
9 changes: 5 additions & 4 deletions cli/azure.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ const (

func newAzureCmd() cli.Command {
return cli.Command{
Name: "azure",
Aliases: []string{"az"},
Usage: "Open Microsoft Azure resource",
Flags: []cli.Flag{},
Name: "azure",
Aliases: []string{"az"},
Usage: "Open Microsoft Azure resource",
Category: categoryCloudProvider,
Flags: []cli.Flag{},
Action: func(c *cli.Context) error {
aws, err := az.GetProvider()
if err != nil {
Expand Down
7 changes: 4 additions & 3 deletions cli/circleci.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (

func newCircleCICmd() cli.Command {
return cli.Command{
Name: "circleci",
Aliases: []string{"cc"},
Usage: "Open CircleCI resource",
Name: "circleci",
Aliases: []string{"cc"},
Usage: "Open CircleCI resource",
Category: categoryContinousIntegration,
Flags: []cli.Flag{
cli.StringFlag{
Name: "org",
Expand Down
10 changes: 10 additions & 0 deletions cli/consts.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package cli

const (
categoryCloudProvider = "Cloud Provider"
categoryContinousIntegration = "Continous Integration"
categoryIncidentManagement = "Incident Management"
categoryMonitor = "Monitor"
categoryWebService = "Web service"
categoryVersioning = "Versioning"
)
9 changes: 5 additions & 4 deletions cli/datadog.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (

func newDatadaogCmd() cli.Command {
return cli.Command{
Name: "datadog",
Aliases: []string{"dd"},
Usage: "Open Datadog resource",
Flags: []cli.Flag{},
Name: "datadog",
Aliases: []string{"dd"},
Usage: "Open Datadog resource",
Category: categoryMonitor,
Flags: []cli.Flag{},
Subcommands: []cli.Command{
newDDWatchDogCmd(),
newDDEventCmd(),
Expand Down
7 changes: 4 additions & 3 deletions cli/firebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ const (

func newFirebaseCmd() cli.Command {
return cli.Command{
Name: "firebase",
Aliases: []string{"fb"},
Usage: "Open Firebase source",
Name: "firebase",
Aliases: []string{"fb"},
Usage: "Open Firebase source",
Category: categoryCloudProvider,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down
5 changes: 3 additions & 2 deletions cli/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ const (

func newGCPCmd() cli.Command {
return cli.Command{
Name: "gcp",
Usage: "Open GCP resource",
Name: "gcp",
Usage: "Open GCP resource",
Category: categoryCloudProvider,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down
7 changes: 4 additions & 3 deletions cli/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (

func newGithubCmd() cli.Command {
return cli.Command{
Name: "github",
Aliases: []string{"gh"},
Usage: "Open Github resource",
Name: "github",
Aliases: []string{"gh"},
Usage: "Open Github resource",
Category: categoryVersioning,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down
7 changes: 4 additions & 3 deletions cli/google.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (

func newGoogleCmd() cli.Command {
return cli.Command{
Name: "google",
Aliases: []string{"g"},
Usage: "Open Google source",
Name: "google",
Aliases: []string{"g"},
Usage: "Open Google source",
Category: categoryWebService,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down
7 changes: 4 additions & 3 deletions cli/pagerduty.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ import (

func newPagerDutyCmd() cli.Command {
return cli.Command{
Name: "pagerduty",
Aliases: []string{"pd"},
Usage: "Open PagerDuty resource",
Name: "pagerduty",
Aliases: []string{"pd"},
Usage: "Open PagerDuty resource",
Category: categoryIncidentManagement,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down
2 changes: 1 addition & 1 deletion cli/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
)

const (
version = "0.0.12"
version = "0.0.13"
)

func newVersionCmd() cli.Command {
Expand Down
7 changes: 4 additions & 3 deletions cli/youtube.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ import (

func newYoutubeCmd() cli.Command {
return cli.Command{
Name: "youtube",
Aliases: []string{"yt"},
Usage: "Open Youtube source",
Name: "youtube",
Aliases: []string{"yt"},
Usage: "Open Youtube source",
Category: categoryWebService,
Flags: []cli.Flag{
cli.StringFlag{
Name: "project",
Expand Down

0 comments on commit f30d178

Please sign in to comment.