Adds first version of status
This commit is contained in:
parent
7e14e90a0a
commit
69f15a4de0
5 changed files with 56 additions and 0 deletions
|
@ -18,6 +18,7 @@ func RootCmd() *cobra.Command {
|
|||
FilterCmd(),
|
||||
InitCmd(),
|
||||
StandaloneCmd(),
|
||||
StatusCmd(),
|
||||
TokenCmd(),
|
||||
PublishCmd(),
|
||||
SyncCmd(),
|
||||
|
|
25
cmd/status.go
Normal file
25
cmd/status.go
Normal file
|
@ -0,0 +1,25 @@
|
|||
package cmd
|
||||
|
||||
import (
|
||||
"git.ctrlz.es/mgdelacroix/campaigner/campaign"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func StatusCmd() *cobra.Command {
|
||||
return &cobra.Command{
|
||||
Use: "status",
|
||||
Short: "Prints the current status of the campaign",
|
||||
Args: cobra.NoArgs,
|
||||
Run: statusCmdF,
|
||||
}
|
||||
}
|
||||
|
||||
func statusCmdF(cmd *cobra.Command, _ []string) {
|
||||
cmp, err := campaign.Read()
|
||||
if err != nil {
|
||||
ErrorAndExit(cmd, err)
|
||||
}
|
||||
|
||||
cmp.PrintStatus(cmd.OutOrStdout())
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue