@holographxyz/cli
Version:
Holograph operator CLI
36 lines (35 loc) • 1.29 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const view_1 = tslib_1.__importDefault(require("./view"));
class ConfigUser extends view_1.default {
static description = 'View the current user information.';
static examples = [
'$ <%= config.bin %> <%= command.id %>',
'$ <%= config.bin %> <%= command.id %> --output json',
'$ <%= config.bin %> <%= command.id %> --output yaml',
'$ <%= config.bin %> <%= command.id %> --output clean',
];
/**
* Command Entry Point
*/
async run() {
const { flags } = await this.parse(view_1.default);
await this.setup();
switch (flags.output) {
case 'json':
this.log(JSON.stringify({ user: this.configJson.user.credentials.address }, null, 2));
break;
case 'yaml':
this.yaml.contents = { user: this.configJson.user.credentials.address };
this.log(this.yaml.toString());
break;
case 'clean':
default:
this.log(`User address: ${this.configJson.user.credentials.address}`);
break;
}
this.exit();
}
}
exports.default = ConfigUser;