Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions local-cli/cliEntry.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function printHelpInformation() {

let output = [
'',
chalk.bold(chalk.cyan((` react-native ${cmdName} [options]`))),
chalk.bold(chalk.cyan((` react-native ${cmdName} ${this.usage()}`))),
` ${this._description}`,
'',
` ${chalk.bold('Options:')}`,
Expand All @@ -62,10 +62,8 @@ function printHelpInformation() {
'',
];

const usage = this.usage();

if (usage !== '[options]') {
const formattedUsage = usage.map(
if (this.examples && this.examples.length > 0) {
const formattedUsage = this.examples.map(
example => ` ${example.desc}: \n ${chalk.cyan(example.cmd)}`,
).join('\n\n');

Expand Down Expand Up @@ -100,7 +98,6 @@ const addCommand = (command: Command, config: Config) => {
.command(command.name, undefined, {
noHelp: !command.description,
})
.usage(command.examples)
.description(command.description)
.action(function runAction() {
const passedOptions = this.opts();
Expand All @@ -115,6 +112,7 @@ const addCommand = (command: Command, config: Config) => {
});

cmd.helpInformation = printHelpInformation.bind(cmd);
cmd.examples = command.examples;

options
.forEach(opt => cmd.option(
Expand Down