Skip to content
Myr

command.js

This file

Path

lib/arguments/command.js

21 lines · 890 bytes · JavaScript

Last changed by

Harden some thingsSindre Sorhusbefore adoption4a0a121

History of this file

Take it

The walk stopped after 200 commits: lines older than c8a6ed7 point at it.

Improve documentation (#1003)ehmickybefore adoptionc8a6ed7

lines 1–7why, one step back
1import {logCommand} from '../verbose/start.js';
2import {getVerboseInfo} from '../verbose/info.js';3import {getStartTime} from '../return/duration.js';4import {joinCommand} from './escape.js';5import {normalizeFdSpecificOption} from './specific.js';67// Compute `result.command`, `result.escapedCommand` and `verbose`-related information

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

line 8why, one step back
8export const handleCommand = (filePath, rawArguments, rawOptions) => {

Improve documentation (#1003)ehmickybefore adoptionc8a6ed7

lines 9–10why, one step back
9 const startTime = getStartTime();
10 const {command, escapedCommand} = joinCommand(filePath, rawArguments);

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

line 11why, one step back
11 const verbose = normalizeFdSpecificOption(rawOptions, 'verbose');

Harden some thingsSindre Sorhusbefore adoption4a0a121

lines 12–13why, one step back
12 // Keep the null prototype, otherwise a polluted `Object.prototype` would inject option values
13 const verboseInfo = getVerboseInfo(verbose, escapedCommand, {__proto__: null, ...rawOptions});

Allow `verbose` option to be a function for custom logging (#1130)ehmickybefore adoption8daf348

line 14why, one step back
14 logCommand(escapedCommand, verboseInfo);

Improve documentation (#1003)ehmickybefore adoptionc8a6ed7

lines 15–21why, one step back
15 return {
16 command,17 escapedCommand,18 startTime,19 verboseInfo,20 };21};