com.beust.jcommander.Parameters.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(12.3k)|赞(0)|评价(0)|浏览(168)

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

Parameters.<init>介绍

暂无

代码示例

代码示例来源:origin: Meituan-Dianping/walle

@Parameters(commandDescription = "remove channel info for apk")
public class RemoveCommand implements IWalleCommand {

  @Parameter(required = true, description = "file1 file2 file3 ...", converter = FileConverter.class, variableArity = true)
  private List<File> files;

  @Override
  public void parse() {
    removeInfo(new Fun1<File, Boolean>() {
      @Override
      public Boolean apply(final File file) {
        try {
          ChannelWriter.remove(file);
          return true;
        } catch (IOException | SignatureNotFoundException e) {
          e.printStackTrace();
        }
        return false;
      }
    });
  }

  private void removeInfo(final Fun1<File, Boolean> fun) {
    for (File file : files) {
      System.out.println(file.getAbsolutePath() + " : " + fun.apply(file));
    }
  }
}

代码示例来源:origin: ehcache/ehcache3

@Parameters(commandNames = "create", commandDescription = "create a clustered cache manager, and it's caches")
class CreateCacheManager extends AbstractCommand {

 @Parameter(names = {"-c", "--config"}, required = true, description = "configuration file")
 private File config;

 CreateCacheManager(BaseOptions base) {
  super(base);
 }

 @Override
 public int execute() {
  if (getClusterLocationOverride() == null) {
   System.out.println("Creating new cache manager from " + config + (isDryRun() ? " [dry-run]" : ""));
  } else {
   System.out.println("Creating new cache manager from " + config + " at overriding location " + getClusterLocationOverride() + (isDryRun() ? " [dry-run]" : ""));
  }
  return 0;
 }
}

代码示例来源:origin: ata4/disunity

@Parameters(
  commandDescription = "Create bundle from a property file."
  @Parameter(
    names = {"-o", "--output"},
    description = "Asset bundle output file",

代码示例来源:origin: ehcache/ehcache3

@Parameters(commandNames = "destroy", commandDescription = "destroy a clustered cache manager, and all of it's caches")
class DestroyCacheManager extends AbstractCommand {

 @Parameter(names = {"-c", "--config"}, required = true, description = "Configuration file to create from")
 private File config;

 @Parameter(names = {"-m", "--match"}, arity = 1, description = "require a matching configuration")
 private boolean requireConfigMatch = true;

 DestroyCacheManager(BaseOptions base) {
  super(base);
 }

 @Override
 public int execute() {
  if (getClusterLocationOverride() == null) {
   System.out.println("Destroying cache manager for config " + config + (isDryRun() ? " [dry-run]" : "") + (requireConfigMatch ? " [matching]" : " [non-matching]"));
  } else {
   System.out.println("Destroying cache manager for config " + config + " at overriding location " + getClusterLocationOverride() + (isDryRun() ? " [dry-run]" : "") + (isDryRun() ? " [matching]" : " [non-matching]"));
  }
  return 0;
 }
}

代码示例来源:origin: Netflix/genie

@Parameters(commandNames = CommandNames.INFO, commandDescription = "Print agent and environment information")
  @Getter
  static class InfoCommandArguments implements AgentCommandArguments {
    @Parameter(names = {"--beans"}, description = "Print beans")
    private Boolean includeBeans = true;
    @Parameter(names = {"--env"}, description = "Print environment variables")
    private Boolean includeEnvironment = true;
    @Parameter(names = {"--properties"}, description = "Print properties")
    private boolean includeProperties = true;

    @Override
    public Class<? extends AgentCommand> getConsumerClass() {
      return InfoCommand.class;
    }
  }
}

代码示例来源:origin: Meituan-Dianping/walle

@Parameters(commandDescription = "put channel info into apk")
public class PutCommand implements IWalleCommand{
  @Parameter(required = true, description = "inputFile [outputFile]", arity = 2, converter = FileConverter.class)
  private List<File> files;
  @Parameter(names = {"-e", "--extraInfo"}, converter = CommaSeparatedKeyValueConverter.class, description = "Comma-separated list of key=value info, eg: -e time=1,type=android")
  private Map<String, String> extraInfo;
  @Parameter(names = {"-c", "--channel"}, description = "single channel, eg: -c meituan")
  private String channel;

代码示例来源:origin: ehcache/ehcache3

@Parameters(commandNames = "update", commandDescription = "update a clustered cache manager, and it's caches to match a new configuration")
class UpdateCacheManager extends AbstractCommand {

 @Parameter(names = {"-c", "--config"}, required = true, description = "updated configuration file")
 private File config;

 @Parameter(names = {"-d", "--allow-destroy"}, description ="allow destruction of caches")
 private boolean destroy = false;

 @Parameter(names = {"-m", "--allow-mutation"}, description ="allow modification of caches")
 private boolean mutation = false;

 UpdateCacheManager(BaseOptions base) {
  super(base);
 }

 @Override
 public int execute() {
  if (getClusterLocationOverride() == null) {
   System.out.println("Updating cache manager to config " + config + (destroy ? " [destroy allowed]" : "") + (mutation ? " [mutate allowed]" : "") + (isDryRun() ? " [dry-run]" : "") + (isDryRun() ? " [matching]" : " [non-matching]"));
  } else {
   System.out.println("Updating cache manager to config " + config + " at overriding location " + getClusterLocationOverride() + (destroy ? " [destroy allowed]" : "") + (mutation ? " [mutate allowed]" : "") + (isDryRun() ? " [dry-run]" : "") + (isDryRun() ? " [matching]" : " [non-matching]"));
  }
  return 0;
 }
}

代码示例来源:origin: google/error-prone

@Parameters(separators = "=")
static class Options {
 @Parameter(names = "-bug_patterns", description = "Path to bugPatterns.txt", required = true)
 private String bugPatterns;
 @Parameter(
   names = "-explanations",
   description = "Path to side-car explanations",
   required = true)
 private String explanations;
 @Parameter(names = "-docs_repository", description = "Path to docs repository", required = true)
 private String docsRepository;
 @Parameter(names = "-examplesDir", description = "Path to examples directory", required = true)
 private String examplesDir;
 @Parameter(
   names = "-target",
   description = "Whether to target the internal or external site",
   converter = TargetEnumConverter.class,
   required = true)
 private Target target;
 @Parameter(
   names = "-use_pygments_highlighting",
   description = "Use pygments for highlighting",
   arity = 1)
 private boolean usePygments = true;
 @Parameter(
   names = "-base_url",
   description = "The base url for links to bugpatterns",
   arity = 1)
 private String baseUrl = null;
}

代码示例来源:origin: ata4/disunity

@Parameters
public class DisUnityRoot extends Command {
  @Parameter(
    names = {"-h", "--help"},
    description = "Print this help.",
  @Parameter(
    names = { "-v", "--verbose" },
    description = "Show more verbose log output."

代码示例来源:origin: Meituan-Dianping/walle

@Parameters(commandDescription = "channel apk batch production")
public class Batch2Command implements IWalleCommand {
  @Parameter(required = true, description = "inputFile [outputDirectory]", arity = 2, converter = FileConverter.class)
  private List<File> files;
  @Parameter(names = {"-f", "--configFile"}, description = "config file (json)")
  private File configFile;

代码示例来源:origin: ata4/disunity

@Parameters(
  commandDescription = "Split asset file into data blocks."
  @Parameter(
    names = {"-l", "--level"},
    description = "Unpacking level"

代码示例来源:origin: Meituan-Dianping/walle

@Parameters(commandDescription = "channel apk batch production")
public class BatchCommand implements IWalleCommand {
  @Parameter(required = true, description = "inputFile [outputDirectory]", arity = 2, converter = FileConverter.class)
  private List<File> files;
  @Parameter(names = {"-e", "--extraInfo"}, converter = CommaSeparatedKeyValueConverter.class, description = "Comma-separated list of key=value info, eg: -e time=1,type=android")
  private Map<String, String> extraInfo;
  @Parameter(names = {"-c", "--channelList"}, description = "Comma-separated list of channel, eg: -c meituan,xiaomi")
  private List<String> channelList;

代码示例来源:origin: Meituan-Dianping/walle

@Parameters(commandDescription = "get channel info from apk and show all by default")
public class ShowCommand implements IWalleCommand {
  @Parameter(required = true, description = "file1 file2 file3 ...", converter = FileConverter.class, variableArity = true)
  private List<File> files;
  @Parameter(names = {"-e", "--extraInfo"}, description = "get channel extra info")
  private boolean showExtraInfo;
  @Parameter(names = {"-c", "--channel"}, description = "get channel")
  private boolean shoChannel;

代码示例来源:origin: Netflix/genie

@Parameters(commandNames = CommandNames.HEARTBEAT, commandDescription = "Send heartbeats to a server")
  @Getter
  static class HeartBeatCommandArguments implements AgentCommandArguments {

    @ParametersDelegate
    private final ArgumentDelegates.ServerArguments serverArguments;

    @Parameter(
      names = {"--duration"},
      description = "How long to run before terminating (in seconds, 0 for unlimited)"
    )
    private int runDuration;

    HeartBeatCommandArguments(final ArgumentDelegates.ServerArguments serverArguments) {
      this.serverArguments = serverArguments;
    }

    @Override
    public Class<? extends AgentCommand> getConsumerClass() {
      return HeartBeatCommand.class;
    }
  }
}

代码示例来源:origin: ata4/disunity

@Parameters(
  commandDescription = "Extract files from bundles."
  @Parameter(
    names = {"-o", "--output"},
    description = "Output directory",
  @Parameter(
    names = {"-f", "--filename"},
    description = "Extract file with this name only."
  @Parameter(
    names = {"-p", "--prop"},
    description = "Write bundle property file."

代码示例来源:origin: Netflix/genie

@Parameters(commandNames = CommandNames.PING, commandDescription = "Test connectivity with the server")
static class PingCommandArguments implements AgentCommandArguments {
  private final ArgumentDelegates.ServerArguments serverArguments;
  @Parameter(
    names = {"--requestId"},
    description = "Request id (defaults to UUID)",

代码示例来源:origin: opentripplanner/OpenTripPlanner

@Parameters(commandNames = "endpoints", commandDescription = "Generate random endpoints for performance testing") 
class CommandEndpoints {
  @Parameter(names = { "-r", "--radius"}, description = "perturbation radius in meters")
  private double radius = 100;
  @Parameter(names = { "-n", "--number"}, description = "number of endpoints to generate")
  private int n = 20;
  @Parameter(names = { "-s", "--stops"}, description = "choose endpoints near stops not street vertices")
  private boolean useStops = false;

代码示例来源:origin: JesusFreke/smali

@Parameters(commandDescription = "Prints an annotated hex dump for the given dex file")
@ExtendedParameters(
    commandName = "dump",
public class DumpCommand extends DexInputCommand {
  @Parameter(names = {"-h", "-?", "--help"}, help = true,
      description = "Show usage information for this command.")
  private boolean help;

代码示例来源:origin: Netflix/genie

@Parameters(commandNames = CommandNames.DOWNLOAD, commandDescription = "Download a set of files")
static class DownloadCommandArguments implements AgentCommandArguments {
  private final ArgumentDelegates.CacheArguments cacheArguments;
  @Parameter(
    names = {"--sources"},
    description = "URLs of files to download",
  private List<URI> fileUris;
  @Parameter(
    names = {"--destinationDirectory"},
    validateWith = ArgumentValidators.StringValidator.class,

代码示例来源:origin: aragozin/jvm-tools

@Parameters(commandDescription = "[VMINFO] Dumps various from local VM")
public static class VmInfo implements Runnable {
  @Parameter(names = {"--sysprops"}, required = false, description = "Dump System.getProperties()")		
  private boolean dumpSysProps = false;
  @Parameter(names = {"--agentprops"}, required = false, description = "Dump agent properties")
  private boolean dumpAgentProps = false;
  @Parameter(names = {"--perf"}, required = false, description = "Dump perf counters")
  private boolean dumpPerfCounters = false;

相关文章