<commit_before>#!/usr/bin/env node

// Native
const { resolve } = require('path')

// Packages
const chalk = require('chalk')
const minimist = require('minimist')

// Ours
const login = require('../lib/login')
const cfg = require('../lib/cfg')
const error = require('../lib/utils/output/error')
const NowTeams = require('../lib/teams')
const logo = require('../lib/utils/output/logo')
const exit = require('../lib/utils/exit')

const argv = minimist(process.argv.slice(2), {
  string: ['config', 'token'],
  boolean: ['help', 'debug'],
  alias: {
    help: 'h',
    config: 'c',
    debug: 'd',
    token: 't',
    switch: 'change'
  }
})

const subcommand = argv._[0]

const help = () => {
  console.log(`
  ${chalk.bold(`${logo} now teams`)} <add | ls | rm | invite>

  ${chalk.dim('Options:')}

    -h, --help              Output usage information
    -c ${chalk.bold.underline('FILE')}, --config=${chalk.bold.underline(
    'FILE'
  )}  Config file
    -d, --debug             Debug mode [off]
    -t ${chalk.bold.underline('TOKEN')}, --token=${chalk.bold.underline(
    'TOKEN'
  )} Login token

  ${chalk.dim('Examples:')}

  ${chalk.gray('–')} Add a new team:

      ${chalk.cyan('$ now teams add')}

  ${chalk.gray('–')} Switch to a team:

      ${chalk.cyan(`$ now switch <id>`)}

      ${chalk.gray('–')} If the id is omitted, you can choose interactively

      ${chalk.yellow(
        'NOTE:'
      )} When you switch, everything you add, list or remove will be scoped that team!

  ${chalk.gray('–')} Invite new members (interactively):

      ${chalk.cyan(`$ now teams invite`)}

  ${chalk.gray('–')} Invite a specific email:

      ${chalk.cyan(`$ now teams invite <EMAIL>`)}

  ${chalk.gray('–')} Remove a team:

      ${chalk.cyan(`$ now teams rm <id>`)}

      ${chalk.gray('–')} If the id is omitted, you can choose interactively
  `)
}

// Options
const debug = argv.debug
const apiUrl = argv.url || 'https://api.zeit.co'
<commit_msg>Improved usage information for `now switch` (#668)<commit_after>#!/usr/bin/env node

// Native
const { resolve } = require('path')

// Packages
const chalk = require('chalk')
const minimist = require('minimist')

// Ours
const login = require('../lib/login')
const cfg = require('../lib/cfg')
const error = require('../lib/utils/output/error')
const NowTeams = require('../lib/teams')
const logo = require('../lib/utils/output/logo')
const exit = require('../lib/utils/exit')

const argv = minimist(process.argv.slice(2), {
  string: ['config', 'token'],
  boolean: ['help', 'debug'],
  alias: {
    help: 'h',
    config: 'c',
    debug: 'd',
    token: 't',
    switch: 'change'
  }
})

const subcommand = argv._[0]

const help = () => {
  console.log(`
  ${chalk.bold(`${logo} now teams`)} <add | ls | rm | invite>

  ${chalk.dim('Options:')}

    -h, --help              Output usage information
    -c ${chalk.bold.underline('FILE')}, --config=${chalk.bold.underline(
    'FILE'
  )}  Config file
    -d, --debug             Debug mode [off]
    -t ${chalk.bold.underline('TOKEN')}, --token=${chalk.bold.underline(
    'TOKEN'
  )} Login token

  ${chalk.dim('Examples:')}

  ${chalk.gray('–')} Add a new team:

      ${chalk.cyan('$ now teams add')}

  ${chalk.gray('–')} Switch to a team:

      ${chalk.cyan(`$ now switch <slug>`)}

      ${chalk.gray(
        '–'
      )} If your team's url is 'zeit.co/teams/name', 'name' is the slug
      ${chalk.gray('–')} If the slug is omitted, you can choose interactively

      ${chalk.yellow(
        'NOTE:'
      )} When you switch, everything you add, list or remove will be scoped that team!

  ${chalk.gray('–')} Invite new members (interactively):

      ${chalk.cyan(`$ now teams invite`)}

  ${chalk.gray('–')} Invite a specific email:

      ${chalk.cyan(`$ now teams invite <EMAIL>`)}

  ${chalk.gray('–')} Remove a team:

      ${chalk.cyan(`$ now teams rm <id>`)}

      ${chalk.gray('–')} If the id is omitted, you can choose interactively
  `)
}

// Options
const debug = argv.debug
const apiUrl = argv.url || 'https://api.zeit.co'

{'fraction_non_alphanumeric': 0.2010856155933876, 'fraction_numerical': 0.0017271157167530224, 'mean_word_length': 2.9745098039215687, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4070375', 'n_tokens_mistral': 1454, 'n_tokens_neox': 1381, 'n_words': 376}