From d1e7dbff2f0c399c739e699b5ec7ba494b727855 Mon Sep 17 00:00:00 2001 From: Tom Donahue Date: Wed, 27 Sep 2023 16:48:39 -0400 Subject: [PATCH] #7 - Options not defined in module aren't passed on --- main.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index a2bd56c..5254df6 100644 --- a/main.go +++ b/main.go @@ -10,9 +10,16 @@ import ( ) func main() { - // Parse command-line flags + // Set up command-line flags altRoot := flag.String("r", "", "Set an alternative Drupal root") altRootLong := flag.String("root", "", "Set an alternative Drupal root (long form)") + + // We need to pash ALL options to Drush, even those we don't set (thanks flag module :)) + flag.CommandLine.ParseErrorsWhitelist = flag.ParseErrorsWhitelist{ + UnknownFlags: true, + } + + // Parse command-line flags flag.Parse() var drupalRoot string