summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/main.go b/main.go
index c5cd2f222..131f1e6e3 100644
--- a/main.go
+++ b/main.go
@@ -49,7 +49,10 @@ func main() {
flaggy.Bool(&configFlag, "c", "config", "Print the default config")
configDirFlag := false
- flaggy.Bool(&configDirFlag, "cd", "config-dir", "Print the config directory")
+ flaggy.Bool(&configDirFlag, "cd", "print-config-dir", "Print the config directory")
+
+ useConfigDir := ""
+ flaggy.String(&useConfigDir, "ucd", "use-config-dir", "override default config directory with provided directory")
workTree := ""
flaggy.String(&workTree, "w", "work-tree", "equivalent of the --work-tree git argument")
@@ -68,6 +71,10 @@ func main() {
gitDir = filepath.Join(repoPath, ".git")
}
+ if useConfigDir != "" {
+ os.Setenv("CONFIG_DIR", useConfigDir)
+ }
+
if workTree != "" {
env.SetGitWorkTreeEnv(workTree)
}