Skip to content
Myr

command.js

This file

Path

lib/arguments/command.js

20 lines · 777 bytes · JavaScript

Last changed by

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

History of this file

Take it

Split files into smaller ones (#976)ehmickybefore adoptiond7c6853

lines 1–6why, 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';6

Add more code comments (#984)ehmickybefore adoptionfdd8a9f

line 7why, one step back
7// 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) => {

Split files into smaller ones (#976)ehmickybefore adoptiond7c6853

line 9why, one step back
9 const startTime = getStartTime();

Upgrade xo (#980)ehmickybefore adoptionccfa412

line 10why, one step back
10 const {command, escapedCommand} = joinCommand(filePath, rawArguments);

Refactor `verbose` logic (#1126)ehmickybefore adoptionf9f1199

lines 11–12why, one step back
11 const verbose = normalizeFdSpecificOption(rawOptions, 'verbose');
12 const verboseInfo = getVerboseInfo(verbose, escapedCommand, {...rawOptions});

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

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

Upgrade xo (#980)ehmickybefore adoptionccfa412

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

Split files into smaller ones (#976)ehmickybefore adoptiond7c6853

line 20why, one step back
20};