<commit_before>import { CompletionFunc } from '@pnpm/command'
import { types as allTypes } from '@pnpm/config'
import { audit } from '@pnpm/plugin-commands-audit'
import { importCommand } from '@pnpm/plugin-commands-import'
import { add, install, link, prune, remove, unlink, update } from '@pnpm/plugin-commands-installation'
import { list, why } from '@pnpm/plugin-commands-listing'
import { outdated } from '@pnpm/plugin-commands-outdated'
import { pack, publish } from '@pnpm/plugin-commands-publishing'
import { rebuild } from '@pnpm/plugin-commands-rebuild'
import {
  exec,
  restart,
  run,
  test,
} from '@pnpm/plugin-commands-script-runners'
import { server } from '@pnpm/plugin-commands-server'
import { store } from '@pnpm/plugin-commands-store'
import { PnpmOptions } from '../types'
import * as bin from './bin'
import createCompletion from './completion'
import createHelp from './help'
import * as installTest from './installTest'
import * as recursive from './recursive'
import * as root from './root'
import R = require('ramda')

export const GLOBAL_OPTIONS = R.pick([
  'color',
  'dir',
  'filter',
  'loglevel',
  'help',
  'parseable',
  'prefix',
  'reporter',
  'stream',
  'test-pattern',
  'workspace-packages',
  'workspace-root',
], allTypes)

export type CommandResponse = string | { output: string, exitCode: number } | undefined

export type Command = (
  opts: PnpmOptions,
  params: string[]
) => CommandResponse | Promise<CommandResponse>

const commands: Array<{
  cliOptionsTypes: () => Object
  commandNames: string[]
  completion?: CompletionFunc
  handler: Function
  help: () => string
  rcOptionsTypes: () => Record<string, unknown>
  shorthands?: Record<string, string | string[]>
}> = [
  add,
  audit,
  bin,
  exec,
  importCommand,
  install,
  installTest,
  link,
  list,
  outdated,
  pack,
  prune,
  publish,
  rebuild,
  recursive,
  remove,
  restart,
  root,
  run,
  server,
  store,
  test,
  unlink,
  update,
  why,
]

const handlerByCommandName: Record<string, Command> = {}
const helpByCommandName: Record<string, () => string> = {}
const cliOptionsTypesByCommandName: Record<string, () => Object> = {}
const rcOptionsTypesByCommandName: Record<string, () => Record<string, unknown>> = {}
const aliasToFullName: Map<string, string> = new Map()
const completionByCommandName: Record<string, CompletionFunc> = {}
const shorthandsByCommandName: Record<string, Record<string, string | string[]>> = {}<commit_msg>fix: the ll command should work<commit_after>import { CompletionFunc } from '@pnpm/command'
import { types as allTypes } from '@pnpm/config'
import { audit } from '@pnpm/plugin-commands-audit'
import { importCommand } from '@pnpm/plugin-commands-import'
import { add, install, link, prune, remove, unlink, update } from '@pnpm/plugin-commands-installation'
import { list, ll, why } from '@pnpm/plugin-commands-listing'
import { outdated } from '@pnpm/plugin-commands-outdated'
import { pack, publish } from '@pnpm/plugin-commands-publishing'
import { rebuild } from '@pnpm/plugin-commands-rebuild'
import {
  exec,
  restart,
  run,
  test,
} from '@pnpm/plugin-commands-script-runners'
import { server } from '@pnpm/plugin-commands-server'
import { store } from '@pnpm/plugin-commands-store'
import { PnpmOptions } from '../types'
import * as bin from './bin'
import createCompletion from './completion'
import createHelp from './help'
import * as installTest from './installTest'
import * as recursive from './recursive'
import * as root from './root'
import R = require('ramda')

export const GLOBAL_OPTIONS = R.pick([
  'color',
  'dir',
  'filter',
  'loglevel',
  'help',
  'parseable',
  'prefix',
  'reporter',
  'stream',
  'test-pattern',
  'workspace-packages',
  'workspace-root',
], allTypes)

export type CommandResponse = string | { output: string, exitCode: number } | undefined

export type Command = (
  opts: PnpmOptions,
  params: string[]
) => CommandResponse | Promise<CommandResponse>

const commands: Array<{
  cliOptionsTypes: () => Object
  commandNames: string[]
  completion?: CompletionFunc
  handler: Function
  help: () => string
  rcOptionsTypes: () => Record<string, unknown>
  shorthands?: Record<string, string | string[]>
}> = [
  add,
  audit,
  bin,
  exec,
  importCommand,
  install,
  installTest,
  link,
  list,
  ll,
  outdated,
  pack,
  prune,
  publish,
  rebuild,
  recursive,
  remove,
  restart,
  root,
  run,
  server,
  store,
  test,
  unlink,
  update,
  why,
]

const handlerByCommandName: Record<string, Command> = {}
const helpByCommandName: Record<string, () => string> = {}
const cliOptionsTypesByCommandName: Record<string, () => Object> = {}
const rcOptionsTypesByCommandName: Record<string, () => Record<string, unknown>> = {}
const aliasToFullName: Map<string, string> = new Map()
const completionByCommandName: Record<string, CompletionFunc> = {}
const shorthandsByCommandName: Record<string, Record<string, string | string[]>> = {}
{'fraction_non_alphanumeric': 0.14156262585581958, 'fraction_numerical': 0.0, 'mean_word_length': 4.593468468468468, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 43, 'https://': 0, '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': '4114587', 'n_tokens_mistral': 1583, 'n_tokens_neox': 1570, 'n_words': 425}