Created
April 23, 2012 08:10
-
-
Save xandrox/2469460 to your computer and use it in GitHub Desktop.
JBoss Forge named option array test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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