version method
Prints the package version from pubspec.yaml and exits.
This reads the version from the installed package, not from a target project.
Implementation
Future<void> version() async {
final version = await YamlHelper().getVersion();
stdout.writeln(version);
exit(0);
}