Skip to content

Commit

Permalink
Create add, push and remove commands
Browse files Browse the repository at this point in the history
  • Loading branch information
berlam committed Oct 4, 2019
1 parent 7dd4594 commit 60b0e12
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
31 changes: 31 additions & 0 deletions cmd/add.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"eager/internal"
"github.com/spf13/cobra"
)

func init() {
// TODO mro Reactivate that command after implementing it
//rootCmd.AddCommand(addCmd)
addCmd.AddCommand(addJiraCmd)

addCmd.PersistentFlags().Bool(internal.FlagAll, false, "Add all items to the backend")
addCmd.PersistentFlags().Bool(internal.FlagForce, false, "Overwrite existing values")
}

var addCmd = &cobra.Command{
Use: "add",
Short: "Add worklog item",
Long: "Add a worklog item to your local store.",
Args: cobra.NoArgs,
}

var addJiraCmd = &cobra.Command{
Use: "jira",
Short: "Add worklog item to Jira",
Long: "Add a worklog item to Atlassian Jira.",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
},
}
27 changes: 27 additions & 0 deletions cmd/push.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

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

func init() {
// TODO mro Reactivate that command after implementing it
//rootCmd.AddCommand(pushCmd)
pushCmd.AddCommand(pushJiraCmd)
}

var pushCmd = &cobra.Command{
Use: "push",
Short: "Push worklog",
Long: "Push your local worklog to a remote store.",
Args: cobra.NoArgs,
}

var pushJiraCmd = &cobra.Command{
Use: "jira",
Short: "Push worklog to Jira",
Long: "Push your local worklog to Atlassian Jira.",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
},
}
28 changes: 28 additions & 0 deletions cmd/remove.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package cmd

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

func init() {
// TODO mro Reactivate that command after implementing it
//rootCmd.AddCommand(removeCmd)
removeCmd.AddCommand(removeJiraCmd)
}

var removeCmd = &cobra.Command{
Use: "remove",
Aliases: []string{"rm"},
Short: "Remove worklog item",
Long: "Remove a worklog item from your local store.",
Args: cobra.NoArgs,
}

var removeJiraCmd = &cobra.Command{
Use: "jira",
Short: "Remove worklog item from Jira",
Long: "Remove a worklog item from Atlassian Jira.",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
},
}

0 comments on commit 60b0e12

Please sign in to comment.