// parse global options
state = parseOptions(tokens, state, metadata.getOptions());
// parse group
if (tokens.hasNext()) {
CommandGroupMetadata group = find(metadata.getCommandGroups(), compose(equalTo(tokens.peek()), CommandGroupMetadata.nameGetter()), null);
if (group != null) {
tokens.next();
state = state.withGroup(group).pushContext(Context.GROUP);
state = parseOptions(tokens, state, state.getGroup().getOptions());