"use strict";
// COMMENTED OUT BC:  Already in CLI
//
// import {Command, Flags , CliUx } from '@oclif/core'
// import _ = require('lodash');
// import { RegistryTarget, ImageExport } from '@codiac.io/codiac-relay-contracts';
// import * as utils from '@codiac.io/cli-tools/sharedUtils';
// import { commandBase } from './command-base';
// export default class ImagesList extends commandBase {
//   static description = 'Renders the list of container images that are configured as project exports.'
//   static aliases = [ "image:list", "img:list" ]
//   static flags = {
//     help: Flags.help({char: 'h'}),
//     output: Flags.custom({char: 'o', options: [ 'table', 'extended', 'json', 'csv' ], default: 'table', description: "Format for the response data."})
//   }
//   static args = {};
//   async run() {
//     const {args, flags} = await this.parse(ImagesList);
//     if (this._projCfg.images) {
//       // cli.log(JSON.stringify(this._projCfg.images));
//       if (flags.output == "json") {
//         this.logger.detail(JSON.stringify(this._projCfg.images, undefined, 2));
//       } else {
//         // if (flags.output != "csv") {
//         //   this._ui.userMessage(`ImageExports in ${utils.inOrange(this._projCfg.name)}:`);
//         // }
//         CliUx.ux.table(utils.toArray<any>(this._projCfg.images), {
//           "Image": { get: row => this._styler.hilite(row.name) },
//           // "Builds": { get: row => (row.readonly == undefined) ? "true" : !row.readonly },
//           "Definition-File": { get: row => (row.definitionFile) ? `${row.definitionFile} ${row.overwrite}`.trim()  : (row.readonly) ? "(built elsewhere)" : (row.overwrite) ? `(gen ${row.overwrite})` : "(in memory auto)" },
//           "Default-Port": { get: row => row.port||"" },
//           "version": { get: row => (row.readonly) ? row.version||"(latest)" : "n/a" },
//           "Registry": { get: row => this.getDefaultRegistryUrl(row), extended: true},
//           "More-Info": { get: row => this.getDefaultRegistryInfoUrl(row)||"", extended: true}
//         }, { extended: (flags.output == "extended"), csv: (flags.output == "csv") });
//       }
//     } else {
//       this._ui.userMessage(`No images are configured as an exports in this project.`);
//     }
//   }
//   private getDefaultRegistry(image: ImageExport): RegistryTarget|undefined {
//     let target:RegistryTarget|undefined;
//     if (image.targets && image.targets.length > 0) {
//       let def = image.targets.find(t => t.environment == "default");
//       target = def||image.targets[0];
//     }
//     return target;
//   }
//   private getDefaultRegistryUrl(image: ImageExport): string|undefined {
//     let output:string|undefined;
//     let target = this.getDefaultRegistry(image);
//     if (target) {
//       let prefix = (image.targets.length > 1) ? `(${target.environment}) ` : "";
//       output = `${prefix}${target.registryUrl}`;
//     }
//     return output;
//   }
//   private getDefaultRegistryInfoUrl(image: ImageExport): string|undefined {
//     let output:string|undefined;
//     let target = this.getDefaultRegistry(image);
//     if (target) {
//       output = target.infoUrl;
//     }
//     return output;
//   }
// }
//# sourceMappingURL=ImagesList.js.map