diff --git a/README.md b/README.md index 68f6d7e..04b6825 100644 --- a/README.md +++ b/README.md @@ -336,3 +336,4 @@ background on this issue. * Rich Liebling ([rliebling](https://github.com/rliebling)) * Seth W. Klein ([sethwklein](https://github.com/sethwklein)) * Vincent Vanackere ([vanackere](https://github.com/vanackere)) +* John W Higgins ([wishdev](https://github.com/wishdev)) diff --git a/main.go b/main.go index 3100561..0b19eba 100644 --- a/main.go +++ b/main.go @@ -22,6 +22,7 @@ var ( flagConf string flagSequential bool flagDecoration string + flagDirectory string decoration Decoration verbose bool globalFlags = flag.NewFlagSet("", flag.ContinueOnError) @@ -71,6 +72,8 @@ func init() { Don't run multiple commands at the same time.`) globalFlags.StringVarP(&flagDecoration, "decoration", "d", "plain", ` How to decorate command output. Choices: none, plain, fancy.`) + globalFlags.StringVarP(&flagDirectory, "directory", "D", ".", ` + Set working directory.`) globalConfig.registerFlags(globalFlags) } @@ -137,6 +140,8 @@ func main() { log.Fatalf("Invalid decoration %s. Choices: none, plain, fancy.", flagDecoration) } + os.Chdir(flagDirectory) + var configs []*Config if flagConf == "" { if flagSequential {