UNPKG

@hashgraph/hedera-cli

Version:

CLI tool to manage and setup developer environments for Hedera Hashgraph.

30 lines (26 loc) 858 B
import stateUtils from '../../utils/state'; import telemetryUtils from '../../utils/telemetry'; import { Logger } from '../../utils/logger'; import type { Command } from '../../../types'; const logger = Logger.getInstance(); export default (program: any) => { program .command('list') .hook('preAction', async (thisCommand: Command) => { const command = [ thisCommand.parent.action().name(), ...thisCommand.parent.args, ]; if (stateUtils.isTelemetryEnabled()) { await telemetryUtils.recordCommand(command.join(' ')); } }) .description('List all available networks') .action(() => { logger.verbose('Listing networks'); logger.log('Available networks:'); stateUtils.getAvailableNetworks().forEach((network) => { logger.log(`- ${network}`); }); }); };