diff --git a/lib/cli.js b/lib/cli.js index c16cd978c..3a4f1599e 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -6,6 +6,8 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); +const EOL = os.EOL; + const formatters = require('./formatters'); const getSysDataPath = require('../utils/get-system-data-dir'); @@ -314,7 +316,7 @@ module.exports = class Cli { const $0 = process?.env?.LANDO_ENTRYPOINT_NAME ?? '$0'; // basic usage - const usage = [`${this.chalk.green('Usage:')}\n ${$0} [args] [options]`]; + const usage = [`${this.chalk.green('Usage:')}${EOL} ${$0} [args] [options]`]; // add experimental mode info if (userConfig.experimental) usage.push(`${this.makeArt('print', {text: '(experimental mode)', color: 'magenta'})}`); @@ -501,7 +503,13 @@ module.exports = class Cli { } // and also allow usage - if (usage) yargs.usage(`${this.chalk.green('Usage:')}\n ${usage}`); + if (usage) { + const prefix = [`$0 ${command}`]; + // add description if available + if (describe) prefix.push(describe); + // and put it 2getha + yargs.usage([...prefix, `${this.chalk.green('Usage:')}${EOL} ${usage}`].join(`${EOL}${EOL}`)); + } }}; }