Hey Andres,
Apologies, I missed the email notification for your message and I don't check the groups that often...
Yes, this is possible.
Are you using a custom IVersionProvider?
One way is to get the "expanded args" from the ParseResult.
This is the list of Strings that were provided on the command line (after @argument files were read and tokenized).
For example:
class SpecInjectedVersionProvider implements CommandLine.IVersionProvider {
@Spec CommandSpec spec;
public String[] getVersion() {
if (spec.commandLine().getParseResult().expandedArgs().contains("-V")) {
return new String[] { "Short version for " + spec.qualifiedName(); }
}
return new String[] { "Long version for " + spec.qualifiedName() };
}
}