org.sonatype.gshell.util.cli2.Argument.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(4.4k)|赞(0)|评价(0)|浏览(65)

本文整理了Java中org.sonatype.gshell.util.cli2.Argument.<init>()方法的一些代码示例,展示了Argument.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Argument.<init>()方法的具体详情如下:
包路径:org.sonatype.gshell.util.cli2.Argument
类名称:Argument
方法名:<init>

Argument.<init>介绍

暂无

代码示例

代码示例来源:origin: org.sonatype.gshell.commands/gshell-text

/**
 * Prints formatted output.
 *
 * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
 *
 * @since 2.0
 */
@Command(name="printf")
public class PrintfCommand
  extends CommandActionSupport
{
  @Argument(index=0, required=true)
  private String format;

  @Argument(index=1, required=true)
  private Collection<String> arguments = null;

  public Object execute(final CommandContext context) throws Exception {
    assert context != null;
    IO io = context.getIo();

    io.out.printf(format, arguments.toArray());

    return Result.SUCCESS;
  }
}

代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs

extends VfsCommandSupport
@Argument(index=0, required=true)
private String sourcePath;
@Argument(index=1, required=true)
private String targetPath;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-logging

@Argument(index=0, required=true)
private String loggerName;
@Argument(index=1, required=true)
private String levelName;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

/**
 * Set the return value.
 *
 * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
 * @since 2.0
 */
@Command(name="return")
public class ReturnCommand
  extends CommandActionSupport
{
  @Argument(required=true)
  private int result;

  public Object execute(final CommandContext context) throws Exception {
    assert context != null;
    return result;
  }
}

代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard

/**
 * Exit the current shell.
 *
 * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
 * @since 2.5
 */
@Command(name="exit")
public class ExitCommand
  extends CommandActionSupport
{
  @Argument
  private int exitCode = 0;

  public Object execute(final CommandContext context) throws Exception {
    assert context != null;

    log.info("Exiting w/code: {}", exitCode);

    // Do not call System.exit(), ask the shell to exit instead.
    throw new ExitNotification(exitCode);
  }
}

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

/**
 * Fail with an exception.
 *
 * @author <a href="mailto:jason@planet57.com">Jason Dillon</a>
 * @since 2.0
 */
@Command(name="fail")
public class FailCommand
  extends CommandActionSupport
{
  @Argument
  private String message = "Failed";

  public Object execute(final CommandContext context) throws Exception {
    assert context != null;
    IO io = context.getIo();

    throw new FailException(message);
  }

  private static class FailException
    extends Exception
  {
    public FailException(String message) {
      super(message);
    }
  }
}

代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs

implements VariableNames
@Argument
private String path;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard

extends CommandActionSupport
@Argument(required = true)
private int index;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs

extends VfsCommandSupport
@Argument(required=true)
private String path;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-vfs

extends VfsCommandSupport
@Argument(required=true)
private String path;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

@Argument(required=true)
private List<String> args;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

extends CommandActionSupport
@Argument(required=true)
private long time;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

private String methodName = "main";
@Argument(index=0, required=true)
private String className;
@Argument(index=1)
private List<String> args;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard

@Argument(index = 0, required = true)
private String name;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-file

@Argument(required=true)
private String path;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-file

@Argument(required=true)
private String path;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-shell

private Character mask;
@Argument
private String prompt;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard

private boolean noTrailingNewline;
@Argument()
private List<String> args;

代码示例来源:origin: org.sonatype.maven.archetype/archetype-commands

private File catalogFile;
@Argument(required=true)
private File repository;

代码示例来源:origin: org.sonatype.gshell.commands/gshell-standard

private SetCommand.Mode mode = SetCommand.Mode.VARIABLE;
@Argument(required = true)
private List<String> args;

相关文章

微信公众号

最新文章

更多

Argument类方法