From 1ab09e4f1b27789121dfba9a6c6e4aa0011ab215 Mon Sep 17 00:00:00 2001 From: Peter Smit Date: Thu, 5 Feb 2015 12:12:37 +0200 Subject: Add option to provide configuration file on command line --- cmd/serve.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd/serve.go') diff --git a/cmd/serve.go b/cmd/serve.go index 23909623..7b593f40 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -27,7 +27,9 @@ var CmdServ = cli.Command{ Usage: "This command should only be called by SSH shell", Description: `Serv provide access auth for repositories`, Action: runServ, - Flags: []cli.Flag{}, + Flags: []cli.Flag{ + cli.StringFlag{"config, c", "custom/conf/app.ini", "Configuration file", ""}, + }, } func setup(logPath string) { @@ -77,6 +79,9 @@ func In(b string, sl map[string]models.AccessType) bool { } func runServ(k *cli.Context) { + if k.IsSet("config") { + setting.CustomConf = k.String("config") + } setup("serv.log") keys := strings.Split(os.Args[2], "-") -- cgit v1.2.3