Skip to content

Commit

Permalink
cli usage and description
Browse files Browse the repository at this point in the history
  • Loading branch information
gavincabbage committed Sep 22, 2019
1 parent bc78381 commit 3b635f9
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions cmd/chiv/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ var version = "v0.0.0"
func main() {

app := cli.App{
Name: "chiv",
HelpName: "chiv",
Usage: "Archive relational database",
Version: version,
Description: "Ar[chiv]e relational database tables to Amazon S3",
HideHelp: true,
Action: run,
Name: "chiv",
HelpName: "chiv",
Usage: "Archive relational database tables to Amazon S3",
Version: version,
UsageText: "chiv [flags...]",
HideHelp: true,
Action: run,
Flags: []cli.Flag{
cli.StringFlag{
Name: "database, d",
Expand Down Expand Up @@ -83,6 +83,14 @@ func main() {
cli.HandleExitCoder(app.Run(os.Args))
}

type config struct {
url string
table string
bucket string
driver string
options []chiv.Option
}

func run(ctx *cli.Context) (err error) {
defer func() {
if err != nil {
Expand Down Expand Up @@ -115,14 +123,6 @@ func run(ctx *cli.Context) (err error) {
return chiv.Archive(db, uploader, config.table, config.bucket, config.options...)
}

type config struct {
url string
table string
bucket string
driver string
options []chiv.Option
}

func from(ctx *cli.Context) config {
cfg := config{
url: ctx.String("database"),
Expand Down

0 comments on commit 3b635f9

Please sign in to comment.