Bump to 2.0.0 in anticipation of release. (#166)
* Bump to 2.0.0 in anticipation of release.
Also tweaked a couple of tiny things.
* Correct version number.
diff --git a/CHANGELOG.md b/CHANGELOG.md
index f6535ad..a17da8d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,12 +1,15 @@
-## 2.0.0-nullsafety
+## 2.0.0-nullsafety.0
-* **BREAKING** Remove APIs that had been marked as deprecated.
- * `allowMulti` and `splitCommas` arguments to `ArgParser.addOption`, use
- `ArgParser.addMultiOption`.
- * `ArgParser.getUsage(),` use `ArgParser.usage`.
- * `Option.abbreviation`, use `Option.abbr`.
- * `Option.defaultValue`, use `Option.defaultsTo`.
- * `OptionType.FLAG/SINGLE/MULTIPLE`, use `OptionType.flag/single/multiple`.
+* Migrate to null safety.
+* **BREAKING** Remove APIs that had been marked as deprecated:
+
+ * Instead of the `allowMulti` and `splitCommas` arguments to
+ `ArgParser.addOption()`, use `ArgParser.addMultiOption()`.
+ * Instead of `ArgParser.getUsage()`, use `ArgParser.usage`.
+ * Instead of `Option.abbreviation`, use `Option.abbr`.
+ * Instead of `Option.defaultValue`, use `Option.defaultsTo`.
+ * Instead of `OptionType.FLAG/SINGLE/MULTIPLE`, use
+ `OptionType.flag/single/multiple`.
## 1.6.0
diff --git a/lib/command_runner.dart b/lib/command_runner.dart
index 0a6566f..90b6a42 100644
--- a/lib/command_runner.dart
+++ b/lib/command_runner.dart
@@ -122,12 +122,12 @@
} on ArgParserException catch (error) {
if (error.commands.isEmpty) usageException(error.message);
- var command = commands[error.commands.first];
+ var command = commands[error.commands.first]!;
for (var commandName in error.commands.skip(1)) {
- command = command!.subcommands[commandName];
+ command = command.subcommands[commandName]!;
}
- command!.usageException(error.message);
+ command.usageException(error.message);
}
}
@@ -170,8 +170,8 @@
// Step into the command.
argResults = argResults.command!;
- command = commands[argResults.name];
- command!._globalResults = topLevelResults;
+ command = commands[argResults.name]!;
+ command._globalResults = topLevelResults;
command._argResults = argResults;
commands = command._subcommands as Map<String, Command<T>>;
commandString += ' ${argResults.name}';
diff --git a/pubspec.yaml b/pubspec.yaml
index 48d74f4..4649817 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,5 +1,5 @@
name: args
-version: 2.0.0-nullsafety
+version: 2.0.0-nullsafety.0
homepage: https://github.com/dart-lang/args
description: >-
Library for defining parsers for parsing raw command-line arguments into a set