How to use the @oclif/parser.flagUsages function in @oclif/parser

To help you get started, we’ve selected a few @oclif/parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github balena-io / balena-cli / automation / capitanodoc / markdown.ts View on Github external
if (!_.isEmpty(command.args)) {
		result.push('### Arguments');
		for (const arg of command.args!) {
			result.push(`#### ${arg.name.toUpperCase()}`, arg.description || '');
		}
	}

	if (!_.isEmpty(command.flags)) {
		result.push('### Options');
		for (const [name, flag] of Object.entries(command.flags!)) {
			if (name === 'help') {
				continue;
			}
			flag.name = name;
			const flagUsage = flagUsages([flag])
				.map(([usage, _description]) => usage)
				.join()
				.trim();
			result.push(`#### ${flagUsage}`);
			result.push(flag.description || '');
		}
	}
	return result;
}

@oclif/parser

arg and flag parser for oclif

MIT
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis