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

/**
 * @license
 * Copyright Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * clasp - The Apps Script CLI
 */

import commander from 'commander';
import loudRejection from 'loud-rejection';
import readPkgUp from 'read-pkg-up';

import {ClaspError} from './clasp-error';
import apis from './commands/apis';
import clone from './commands/clone';
import create from './commands/create';
import defaultCmd from './commands/default';
import deploy from './commands/deploy';
import deployments from './commands/deployments';
import help from './commands/help';
import list from './commands/list';
import login from './commands/login';
import logout from './commands/logout';
import logs from './commands/logs';
import openCmd from './commands/open';
import pull from './commands/pull';
import push from './commands/push';
import run from './commands/run';
import setting from './commands/setting';
import status from './commands/status';
import undeploy from './commands/undeploy';
import version from './commands/version';
import versions from './commands/versions';
import {PROJECT_NAME} from './constants';
import {spinner, stopSpinner} from './utils';

// Ensure any unhandled exception won't go unnoticed
loudRejection();

const manifest = readPkgUp.sync({cwd: require.resolve('.')});
// CLI

/**
 * Set global CLI configurations
 */

/**
 * Displays clasp version
 */
commander.version(manifest ? manifest.packageJson.version : 'unknown', '-v, --version', 'output the current version');

commander.name(PROJECT_NAME).usage('<command> [options]').description(`${PROJECT_NAME} - The Apps Script CLI`);

/**
 * Logs the user in. Saves the client credentials to an rc file.
 * @name login
 * @param {string?} [--no-localhost] Do not run a local server, manually enter code instead.
 * @param {string?} [--creds] Relative path to credentials (from GCP).
 * @example login (uses default clasp credentials)
 * @example login --creds credentials.json (uses your credentials file).
 * @see test<commit_msg>fix: commander 6 option clash<commit_after>#!/usr/bin/env node

/**
 * @license
 * Copyright Google Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * clasp - The Apps Script CLI
 */

import commander from 'commander';
import loudRejection from 'loud-rejection';
import readPkgUp from 'read-pkg-up';

import {ClaspError} from './clasp-error';
import apis from './commands/apis';
import clone from './commands/clone';
import create from './commands/create';
import defaultCmd from './commands/default';
import deploy from './commands/deploy';
import deployments from './commands/deployments';
import help from './commands/help';
import list from './commands/list';
import login from './commands/login';
import logout from './commands/logout';
import logs from './commands/logs';
import openCmd from './commands/open';
import pull from './commands/pull';
import push from './commands/push';
import run from './commands/run';
import setting from './commands/setting';
import status from './commands/status';
import undeploy from './commands/undeploy';
import version from './commands/version';
import versions from './commands/versions';
import {PROJECT_NAME} from './constants';
import {spinner, stopSpinner} from './utils';

// Ensure any unhandled exception won't go unnoticed
loudRejection();

const manifest = readPkgUp.sync({cwd: require.resolve('.')});
// CLI

/**
 * Set global CLI configurations
 */
commander.storeOptionsAsProperties(false);

/**
 * Displays clasp version
 */
commander.version(manifest ? manifest.packageJson.version : 'unknown', '-v, --version', 'output the current version');

commander.name(PROJECT_NAME).usage('<command> [options]').description(`${PROJECT_NAME} - The Apps Script CLI`);

/**
 * Logs the user in. Saves the client credentials to an rc file.
 * @name login
 * @param {string?} [--no-localhost] Do not run a local server, manually enter code instead.
 * @param {string?} [--creds] Relative path to credentials (from GCP).
 * @example login (uses default clasp credentials)
 * @example login --creds credentials.json (uses your credentials file).
 * @see test
{'fraction_non_alphanumeric': 0.13075293664548432, 'fraction_numerical': 0.0017331022530329288, 'mean_word_length': 4.28382502543235, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '1620224', 'n_tokens_mistral': 1413, 'n_tokens_neox': 1380, 'n_words': 566}