args
args copied to clipboard
Why is `CommandRunner._usageWithoutDescription` private?
I think it should be public. It makes testing unnecessarily harder.
As a workaround, I've created the following extension which lets me test UsageExceptions thrown by the package:
import 'package:args/command_runner.dart';
extension CommandRunnerX on CommandRunner {
/// Workaround for https://github.com/dart-lang/args/issues/221.
String get usageWithoutDescription {
final crop = description.length + 2;
return usage.substring(crop);
}
}