Skip to content

Instantly share code, notes, and snippets.

@xandrox
Created April 23, 2012 08:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xandrox/2469460 to your computer and use it in GitHub Desktop.
Save xandrox/2469460 to your computer and use it in GitHub Desktop.
JBoss Forge named option array test
arraytest asds --array "sadsad" "asdsa"
***INFO*** The command [arraytest] takes [1] unnamed argument(s), but found [2].
***INFO*** Swallowed unknown token [asdsa] for command [arraytest].
[sadsad]
package de.adorsys.forge.plugin.curl;
import java.util.Arrays;
import org.jboss.forge.shell.plugins.Alias;
import org.jboss.forge.shell.plugins.DefaultCommand;
import org.jboss.forge.shell.plugins.Option;
import org.jboss.forge.shell.plugins.PipeOut;
import org.jboss.forge.shell.plugins.Plugin;
@Alias("arraytest")
public class TestPlugin implements Plugin {
@DefaultCommand
public void run(
@Option(name = "array") final String[] test,
@Option final String nonNamed,
PipeOut out
) {
out.println(Arrays.asList(test).toString());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment