-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create add, push and remove commands
- Loading branch information
Showing
3 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { | ||
}, | ||
} |