handleVersionFlag function
Handles the --version / -v top-level flag.
Returns true when the flag was present and the version has been printed,
in which case the caller should exit immediately. Returns false when the
flag was absent and normal command dispatch should proceed.
Implementation
Future<bool> handleVersionFlag(List<String> args) async {
if (!args.contains('--version') && !args.contains('-v')) {
return false;
}
logger.info(await getAppVersion());
return true;
}