summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Tomé <carlostome1990@gmail.com>2014-11-19 17:07:53 -0600
committerAustin Seipp <austin@well-typed.com>2014-11-19 17:07:53 -0600
commit80f6fc1769296330687d54179a6dc149f02d6348 (patch)
treefb484cd66ed112f401e2d820ffa3f9187fea3628
parent4dd87c5e3ebd0569fdd19695f3e9c82102404a4f (diff)
downloadhaskell-80f6fc1769296330687d54179a6dc149f02d6348.tar.gz
compiler/main: fixes #9776
Test Plan: test T9776 under tests/driver Reviewers: jstolarek, austin Reviewed By: jstolarek, austin Subscribers: jstolarek, thomie, carter Differential Revision: https://phabricator.haskell.org/D503 GHC Trac Issues: #9776
-rw-r--r--compiler/main/CmdLineParser.hs3
-rw-r--r--testsuite/tests/driver/T9776.hs1
-rw-r--r--testsuite/tests/driver/T9776.stderr2
-rw-r--r--testsuite/tests/driver/all.T3
4 files changed, 8 insertions, 1 deletions
diff --git a/compiler/main/CmdLineParser.hs b/compiler/main/CmdLineParser.hs
index 7d7bbfe95e..a4b9118f9d 100644
--- a/compiler/main/CmdLineParser.hs
+++ b/compiler/main/CmdLineParser.hs
@@ -191,8 +191,9 @@ processOneArg opt_kind rest arg args
[] -> missingArgErr dash_arg
(L _ arg1:args1) -> Right (f arg1, args1)
+ -- See Trac #9776
SepArg f -> case args of
- [] -> unknownFlagErr dash_arg
+ [] -> missingArgErr dash_arg
(L _ arg1:args1) -> Right (f arg1, args1)
Prefix f | notNull rest_no_eq -> Right (f rest_no_eq, args)
diff --git a/testsuite/tests/driver/T9776.hs b/testsuite/tests/driver/T9776.hs
new file mode 100644
index 0000000000..28551cf11c
--- /dev/null
+++ b/testsuite/tests/driver/T9776.hs
@@ -0,0 +1 @@
+module T9776 where
diff --git a/testsuite/tests/driver/T9776.stderr b/testsuite/tests/driver/T9776.stderr
new file mode 100644
index 0000000000..328a105e61
--- /dev/null
+++ b/testsuite/tests/driver/T9776.stderr
@@ -0,0 +1,2 @@
+ghc-stage2: on the commandline: missing argument for flag: -frule-check
+Usage: For basic information, try the `--help' option.
diff --git a/testsuite/tests/driver/all.T b/testsuite/tests/driver/all.T
index 7236ec1a3a..f2c58d1150 100644
--- a/testsuite/tests/driver/all.T
+++ b/testsuite/tests/driver/all.T
@@ -406,3 +406,6 @@ test('T9050', normal, build_T9050, [])
test('write_interface_oneshot', normal, run_command, ['$MAKE -s --no-print-directory write_interface_oneshot'])
test('write_interface_make', normal, run_command, ['$MAKE -s --no-print-directory write_interface_make'])
+
+test('T9776', normal, compile_fail, ['-frule-check'])
+