From 913a2fd0656c393e743686cf6fe823a963916463 Mon Sep 17 00:00:00 2001 From: mjarkk Date: Tue, 27 Jul 2021 22:03:37 +0200 Subject: Allow having multiple config files --- main.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'main.go') diff --git a/main.go b/main.go index 67d6e8287..02088b5bd 100644 --- a/main.go +++ b/main.go @@ -61,6 +61,9 @@ func main() { gitDir := "" flaggy.String(&gitDir, "g", "git-dir", "equivalent of the --git-dir git argument") + customConfig := "" + flaggy.String(&customConfig, "cf", "config-file", "Comma seperated list to custom config file(s)") + flaggy.Parse() if repoPath != "" { @@ -72,6 +75,10 @@ func main() { gitDir = filepath.Join(repoPath, ".git") } + if customConfig != "" { + os.Setenv("LG_CONFIG_FILE", customConfig) + } + if useConfigDir != "" { os.Setenv("CONFIG_DIR", useConfigDir) } -- cgit v1.2.3