Use cli Flags directly and not some helper funcs

Signed-off-by: Matthias Loibl <mail@matthiasloibl.com>
This commit is contained in:
Matthias Loibl 2016-11-09 23:18:22 +01:00
parent 475ddd8d89
commit 5cd093aa46
8 changed files with 91 additions and 69 deletions

View file

@ -6,18 +6,16 @@ package cmd
import (
"fmt"
"io/ioutil"
"log"
"os"
"path"
"time"
"io/ioutil"
"github.com/Unknwon/cae/zip"
"github.com/urfave/cli"
"github.com/go-gitea/gitea/models"
"github.com/go-gitea/gitea/modules/setting"
"github.com/urfave/cli"
)
// CmdDump represents the available dump sub-command.
@ -28,9 +26,20 @@ var CmdDump = cli.Command{
It can be used for backup and capture Gogs server image to send to maintainer`,
Action: runDump,
Flags: []cli.Flag{
stringFlag("config, c", "custom/conf/app.ini", "Custom configuration file path"),
boolFlag("verbose, v", "Show process details"),
stringFlag("tempdir, t", os.TempDir(), "Temporary dir path"),
cli.StringFlag{
Name: "config, c",
Value: "custom/conf/app.ini",
Usage: "Custom configuration file path",
},
cli.BoolFlag{
Name: "verbose, v",
Usage: "Show process details",
},
cli.StringFlag{
Name: "tempdir, t",
Value: os.TempDir(),
Usage: "Temporary dir path",
},
},
}