All files / src/commands/ng ng.get.command.js

81.81% Statements 18/22
100% Branches 1/1
0% Functions 0/1
81.81% Lines 18/22

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x 193x         193x 193x  
import { defineCommand } from '../../lib/define-command.js';
import { printResults } from '../../lib/ng-print.js';
import { humanJsonOutputFormatOption, orgaIdOrNameOption } from '../global.options.js';
import { ngAnyIdOrLabelArg } from './ng.args.js';
import { ngResourceTypeOption } from './ng.options.js';
 
export const ngGetCommand = defineCommand({
  description: 'Get details about a Network Group, a member or a peer',
  since: '3.12.0',
  options: {
    type: ngResourceTypeOption,
    org: orgaIdOrNameOption,
    format: humanJsonOutputFormatOption,
  },
  args: [ngAnyIdOrLabelArg],
  async handler(options, idOrLabel) {
    const { org, format } = options;
    const type = options.type ?? 'single';

    await printResults(idOrLabel, org, format, 'get', type);
  },
});