public void pkgList(List<? extends Package> packagesList) {
   CommandInfo cmdInfo = cset.newCommandInfo(CommandInfo.CMD_LIST);
   try {
     if (packagesList.isEmpty()) {
       log.info("None");
     } else {
       NuxeoConnectClient.getPackageManager().sort(packagesList);
       StringBuilder sb = new StringBuilder();
       for (Package pkg : packagesList) {
         newPackageInfo(cmdInfo, pkg);
         String packageDescription = PackageState.getByValue(pkg.getState()).getLabel();
         packageDescription = String.format("%6s %11s\t", pkg.getType(), packageDescription);
         if (pkg.getState() == PackageState.REMOTE.getValue()
             && pkg.getType() != PackageType.STUDIO
             && pkg.getVisibility() != PackageVisibility.PUBLIC
             && !LogicalInstanceIdentifier.isRegistered()) {
           packageDescription += "Registration required for ";
         }
         packageDescription += String.format("%s (id: %s)\n", pkg.getName(), pkg.getId());
         sb.append(packageDescription);
       }
       log.info(sb.toString());
     }
   } catch (Exception e) {
     log.error(e);
     cmdInfo.exitCode = 1;
   }
 }
 /**
  * @param packages List of packages identified by their ID, name or local filename.
  * @since 5.7
  */
 public boolean pkgShow(List<String> packages) {
   boolean cmdOk = true;
   if (packages == null || packages.isEmpty()) {
     return cmdOk;
   }
   StringBuilder sb = new StringBuilder();
   sb.append("****************************************");
   for (String pkg : packages) {
     CommandInfo cmdInfo = cset.newCommandInfo(CommandInfo.CMD_SHOW);
     cmdInfo.param = pkg;
     try {
       PackageInfo packageInfo = newPackageInfo(cmdInfo, findPackage(pkg));
       sb.append("\nPackage: " + packageInfo.id);
       sb.append("\nState: " + packageInfo.state);
       sb.append("\nVersion: " + packageInfo.version);
       sb.append("\nName: " + packageInfo.name);
       sb.append("\nType: " + packageInfo.type);
       sb.append("\nVisibility: " + packageInfo.visibility);
       if (packageInfo.state == PackageState.REMOTE
           && packageInfo.type != PackageType.STUDIO
           && packageInfo.visibility != PackageVisibility.PUBLIC
           && !LogicalInstanceIdentifier.isRegistered()) {
         sb.append(" (registration required)");
       }
       sb.append("\nTarget platforms: " + ArrayUtils.toString(packageInfo.targetPlatforms));
       appendIfNotEmpty(sb, "\nVendor: ", packageInfo.vendor);
       sb.append("\nSupports hot-reload: " + packageInfo.supportsHotReload);
       sb.append("\nSupported: " + packageInfo.supported);
       sb.append("\nProduction state: " + packageInfo.productionState);
       sb.append("\nValidation state: " + packageInfo.validationState);
       appendIfNotEmpty(sb, "\nProvides: ", packageInfo.provides);
       appendIfNotEmpty(sb, "\nDepends: ", packageInfo.dependencies);
       appendIfNotEmpty(sb, "\nConflicts: ", packageInfo.conflicts);
       appendIfNotEmpty(sb, "\nTitle: ", packageInfo.title);
       appendIfNotEmpty(sb, "\nDescription: ", packageInfo.description);
       appendIfNotEmpty(sb, "\nHomepage: ", packageInfo.homePage);
       appendIfNotEmpty(sb, "\nLicense: ", packageInfo.licenseType);
       appendIfNotEmpty(sb, "\nLicense URL: ", packageInfo.licenseUrl);
       sb.append("\n****************************************");
     } catch (PackageException e) {
       cmdOk = false;
       cmdInfo.exitCode = 1;
       cmdInfo.newMessage(e);
     }
   }
   log.info(sb.toString());
   return cmdOk;
 }
 public String getCLID() throws NoCLID {
   return LogicalInstanceIdentifier.instance().getCLID();
 }