From fe8c3544c4d632eb9f896e38a8ce13149f90ef00 Mon Sep 17 00:00:00 2001 From: ahh Date: Thu, 13 Dec 2018 10:24:05 -0500 Subject: [PATCH] refactor: update help --- cmd/cmd_airtable.go | 6 ++++-- cmd/cmd_db.go | 7 ++++--- cmd/cmd_graph.go | 3 ++- cmd/cmd_pull.go | 3 ++- cmd/cmd_run.go | 3 ++- cmd/cmd_web.go | 3 ++- 6 files changed, 16 insertions(+), 9 deletions(-) diff --git a/cmd/cmd_airtable.go b/cmd/cmd_airtable.go index ec97133d4..167be2200 100644 --- a/cmd/cmd_airtable.go +++ b/cmd/cmd_airtable.go @@ -75,7 +75,8 @@ func (cmd *airtableCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *airtableCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra.Command { cc := &cobra.Command{ - Use: "airtable", + Use: "airtable", + Short: "Upload issue info stored in database to airtable spreadsheets", } cc.AddCommand(cmd.airtableSyncCommand()) return cc @@ -83,7 +84,8 @@ func (cmd *airtableCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra. func (cmd *airtableCommand) airtableSyncCommand() *cobra.Command { cc := &cobra.Command{ - Use: "sync", + Use: "sync", + Short: "Upload issue info stored in database to airtable spreadsheets", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts var err error diff --git a/cmd/cmd_db.go b/cmd/cmd_db.go index 3743352a0..678400e28 100644 --- a/cmd/cmd_db.go +++ b/cmd/cmd_db.go @@ -3,11 +3,11 @@ package main import ( "encoding/json" "fmt" - "moul.io/depviz/pkg/issues" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" + "moul.io/depviz/pkg/issues" ) type dbOptions struct{} @@ -42,7 +42,8 @@ func (cmd *dbCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *dbCommand) dbDumpCommand() *cobra.Command { cc := &cobra.Command{ - Use: "dump", + Use: "dump", + Short: "Print all issues stored in the database, formatted as JSON", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts return dbDump(&opts) @@ -68,4 +69,4 @@ func dbDump(opts *dbOptions) error { } fmt.Println(string(out)) return nil -} \ No newline at end of file +} diff --git a/cmd/cmd_graph.go b/cmd/cmd_graph.go index 496b59202..f97cbc18f 100644 --- a/cmd/cmd_graph.go +++ b/cmd/cmd_graph.go @@ -65,7 +65,8 @@ func (cmd *graphCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *graphCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra.Command { cc := &cobra.Command{ - Use: "graph", + Use: "graph", + Short: "Output graph of relationships between all issues stored in database", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts var err error diff --git a/cmd/cmd_pull.go b/cmd/cmd_pull.go index c22542fac..c2ce26a0b 100644 --- a/cmd/cmd_pull.go +++ b/cmd/cmd_pull.go @@ -45,7 +45,8 @@ func (cmd *pullCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *pullCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra.Command { cc := &cobra.Command{ - Use: "pull", + Use: "pull", + Short: "Pull issues and update database without outputting graph", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts var err error diff --git a/cmd/cmd_run.go b/cmd/cmd_run.go index a0020b286..07b42af09 100644 --- a/cmd/cmd_run.go +++ b/cmd/cmd_run.go @@ -41,7 +41,8 @@ func (cmd *runCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *runCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra.Command { cc := &cobra.Command{ - Use: "run", + Use: "run", + Short: "Pull issues, update database, and output a graph of relationships between issues", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts opts.GraphOptions = dc["graph"].(*graphCommand).opts diff --git a/cmd/cmd_web.go b/cmd/cmd_web.go index 48010d886..c33d3de54 100644 --- a/cmd/cmd_web.go +++ b/cmd/cmd_web.go @@ -52,7 +52,8 @@ func (cmd *webCommand) ParseFlags(flags *pflag.FlagSet) { func (cmd *webCommand) NewCobraCommand(dc map[string]DepvizCommand) *cobra.Command { cc := &cobra.Command{ - Use: "web", + Use: "web", + Short: "Run depviz as a web server", RunE: func(_ *cobra.Command, args []string) error { opts := cmd.opts return web(&opts)