コード例 #1
0
  void run() {
    try {
      cloudInfo.props.init(getPropertiesFile());

      cloudInfo.locationId = options.valueOf(locationSpec);
      cloudInfo.verbose = options.has(verboseSpec);

      if (options.has(showLocationsSpec)) {
        cloudInfo.init();
        cloudInfo.showLocations();
      } else if (options.has(showHardwareSpec)) {
        cloudInfo.init();
        cloudInfo.showHardware();
      } else if (options.has(showImagesSpec)) {
        cloudInfo.init();
        cloudInfo.showImages();
      } else {
        CliUtils.printHelpAndExit(parser);
      }
    } finally {
      cloudInfo.shutdown();
    }
  }
コード例 #2
0
 CloudInfoCli(CloudInfo cloudInfo, String[] args) {
   this.cloudInfo = cloudInfo;
   this.options = CliUtils.initOptionsWithHelp(parser, args);
 }