How to use the yargonaut.style function in yargonaut

To help you get started, we’ve selected a few yargonaut 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 lando / lando / lib / cli.js View on Github external
run(tasks = [], config = {}) {
    const yargonaut = require('yargonaut');
    yargonaut.style('green').errorsStyle('red');
    const yargs = require('yargs');

    // Clear any task caches we have
    if (yargs.argv.clear) {
      if (fs.existsSync(process.landoTaskCacheFile)) fs.unlinkSync(process.landoTaskCacheFile);
      if (fs.existsSync(process.landoAppTaskCacheFile)) fs.unlinkSync(process.landoAppTaskCacheFile);
      console.log('Lando has cleared the tasks cache!');
      process.exit(0);
    }

    // Start up the CLI
    const cmd = !_.has(process, 'pkg') ? '$0' : path.basename(_.get(process, 'execPath', 'lando'));
    yargs.usage(`Usage: ${cmd}  [args] [options]`)
      .demandCommand(1, 'You need at least one command before moving on')
      .example('lando start', 'Run lando start')
      .example('lando rebuild --help', 'Get help about using the lando rebuild command')
github eden-js / cli / core / cli / core.js View on Github external
// require dependencies
const fs = require('fs-extra');
const path = require('path');
const chalk = require('chalk');
const Events = require('events');
const yargonaut = require('yargonaut'); // Must precede yargs
const prettyTime = require('pretty-hrtime');
const extractComments = require('extract-comments');

// initialization logic
const initEden = require('lib/utilities/init');
const packageJSON = require('../../package.json');

// Set yargs colors
yargonaut
  .style('underline.green')
  .errorsStyle('red');

/**
 * create eden generator class
 *
 * @extends Events
 */
class EdenCore extends Events {
  /**
   * construct eden generator
   */
  constructor() {
    // run super
    // eslint-disable-next-line prefer-rest-params
    super(...arguments);
github scalarwaves / iloa / src / iloa.js View on Github external
#!/usr/bin/env node
/* eslint-disablemax-len: 0, no-unused-expressions: 0 */
const chalk = require('chalk')
const pkg = require('../package.json')
const yargonaut = require('yargonaut')
  .style('bold.underline', 'Commands:')
  .style('bold.underline', 'Options:')
  .style('bold.cyan', 'boolean')
  .style('bold.yellow', 'string')
  .style('bold.magenta', 'number')
  .style('bold.blue', 'default:')
  .style('bold.green', 'aliases:')
const yargs = require('yargs')
yargs
  .commandDir('commands')
  .usage(`${chalk.yellow(`${yargonaut.asFont('iloa', 'Small Slant')}`)}\n${chalk.bold.underline('Usage:')}\n$0  [options]`)
  .help('h')
  .alias('h', 'help')
  .option('v', {
    alias: 'verbose',
    type: 'boolean',
github scalarwaves / leximaven / src / leximaven.js View on Github external
#!/usr/bin/env node
/* eslint max-len: 0, no-unused-expressions: 0 */
const chalk = require('chalk')
const pkg = require('../package.json')
const yargonaut = require('yargonaut')
  .style('bold.underline', 'Commands:')
  .style('bold.underline', 'Options:')
  .style('bold.cyan', 'boolean')
  .style('bold.yellow', 'string')
  .style('bold.magenta', 'number')
  .style('bold.blue', 'default:')
  .style('bold.green', 'aliases:')
const yargs = require('yargs')
yargs
  .commandDir('commands')
  .usage(`${chalk.yellow(`${yargonaut.asFont('leximaven', 'Small Slant')}`)}\n${chalk.bold.underline('Usage:')}\n$0  [options]`)
  .help('h')
  .alias('h', 'help')
  .option('v', {
    alias: 'verbose',
    type: 'boolean',
github wildbit / postmark-cli / src / index.ts View on Github external
#!/usr/bin/env node

import chalk from 'chalk'

require('yargonaut')
  .style('yellow')
  .errorsStyle('red')

require('yargs')
  .env('POSTMARK')
  .commandDir('commands')
  .demandCommand()
  .help()
  .usage(
    chalk.yellow(`
              ____           _                        _    
 _________   |  _ \\ ___  ___| |_ _ __ ___   __ _ _ __| | __
| \\     / |  | |_) / _ \\/ __| __| '_ ' _ \\ / _\` | '__| |/ /
|  '...'  |  |  __/ (_) \\__ \\ |_| | | | | | (_| | |  |   < 
|__/___\\__|  |_|   \\___/|___/\\__|_| |_| |_|\\__,_|_|  |_|\\_\\`)
  ).argv
github imodeljs / imodeljs / tools / webpack / bin / bentley-webpack-tools.js View on Github external
#!/usr/bin/env node

/*---------------------------------------------------------------------------------------------
* Copyright (c) 2019 Bentley Systems, Incorporated. All rights reserved.
* Licensed under the MIT License. See LICENSE.md in the project root for license terms.
*--------------------------------------------------------------------------------------------*/

"use strict";

require('yargonaut')
  .style('green')
  .style('yellow', "required")
  .style('cyan', "Positionals:")
  .helpStyle('cyan')
  .errorsStyle('red.bold');

const chalk = require("chalk");
const yargs = require("yargs");
const argv = yargs
  .wrap(Math.min(120, yargs.terminalWidth()))
  .usage(`\n${chalk.bold("$0")} ${chalk.yellow("")}`)
  .command(require("../scripts/start"))
  .command(require("../scripts/start-backend"))
  .command(require("../scripts/start-frontend"))
  .command(require("../scripts/test"))
  .command(require("../scripts/test-e2e"))
github rxstack / rxstack / packages / core / src / console / command-manager.ts View on Github external
execute(): void {
    require('yargonaut')
      .style('blue')
      .style('yellow', 'required')
      .helpStyle('green')
      .errorsStyle('red')
    ;

    cli.usage(`Usage: $0  [options]`);
    this.commands.forEach((command) => {
      cli.command(command);
    });

    cli.demandCommand(1)
      .strict()
      .alias('v', 'version')
      .help('h')
      .alias('h', 'help')
github iWinston / typeorm-plus / src / cli.ts View on Github external
.command(new MigrationGenerateCommand())
    .command(new MigrationRunCommand())
    .command(new MigrationShowCommand())
    .command(new MigrationRevertCommand())
    .command(new VersionCommand())
    .command(new CacheClearCommand())
    .command(new InitCommand())
    .recommendCommands()
    .demandCommand(1)
    .strict()
    .alias("v", "version")
    .help("h")
    .alias("h", "help")
    .argv;

require("yargonaut")
    .style("blue")
    .style("yellow", "required")
    .helpStyle("green")
    .errorsStyle("red");
github docsifyjs / docsify-cli / lib / cli.js View on Github external
const chalk = require('chalk')
const updateNotifier = require('update-notifier')

const pkg = require('../package.json')
const run = require('../lib')

updateNotifier({pkg: pkg}).notify()

const Locales = require('../tools/locales')
const y18n = new Locales()

require('yargonaut')
  .style('yellow', 'required')
  .helpStyle('green')
  .errorsStyle('red.bold')

require('yargs')
  .demandCommand(1, chalk.red('[ERROR] 0 arguments passed. Please specify a command'))
  .strict()
  .recommendCommands()
  .usage(chalk.bold(y18n.__('usage') + ': docsify  
github vesper-framework / vesper / src / cli.ts View on Github external
import "reflect-metadata";
import {InitCommand} from "./commands/InitCommand";
import {GenerateModelsCommand} from "./commands/GenerateModelsCommand";

require("yargs")
    .usage("Usage: $0  [options]")
    .command(new InitCommand())
    .command(new GenerateModelsCommand())
    .demandCommand(1)
    .strict()
    .alias("v", "version")
    .help("h")
    .alias("h", "help")
    .argv;

require("yargonaut")
    .style("blue")
    .style("yellow", "required")
    .helpStyle("green")
    .errorsStyle("red");

yargonaut

Decorate yargs content with chalk styles and figlet fonts

Apache-2.0
Latest version published 6 years ago

Package Health Score

47 / 100
Full package analysis