Index: pkg/args/lib/src/parser.dart |
diff --git a/pkg/args/lib/src/parser.dart b/pkg/args/lib/src/parser.dart |
index 4d3417a12599df4b323b9e120f5501db597c65b1..9cd141c00a334b63b6ac491d5c38deb05aea510b 100644 |
--- a/pkg/args/lib/src/parser.dart |
+++ b/pkg/args/lib/src/parser.dart |
@@ -46,6 +46,7 @@ class Parser { |
/// Parses the arguments. This can only be called once. |
ArgResults parse() { |
+ var arguments = args.toList(); |
var commandResults = null; |
// Parse the args. |
@@ -91,7 +92,8 @@ class Parser { |
// Add in the leftover arguments we didn't parse to the innermost command. |
rest.addAll(args); |
args.clear(); |
- return newArgResults(grammar, results, commandName, commandResults, rest); |
+ return newArgResults(grammar, results, commandName, commandResults, rest, |
+ arguments); |
} |
/// Pulls the value for [option] from the second argument in [args]. |