command.js
This file
Path
lib/arguments/command.js
19 lines · 730 bytes · JavaScript
Last changed by
Add more code comments (#984)ehmickybefore adoptionfdd8a9f
History of this fileTake it
1234567891011121314151617181920import {logCommand} from '../verbose/start.js';import {getVerboseInfo} from '../verbose/info.js';import {getStartTime} from '../return/duration.js';import {joinCommand} from './escape.js';import {normalizeFdSpecificOption} from './specific.js';
// Compute `result.command`, `result.escapedCommand` and `verbose`-related informationexport const handleCommand = (filePath, rawArguments, rawOptions) => { const startTime = getStartTime(); const {command, escapedCommand} = joinCommand(filePath, rawArguments); const verboseInfo = getVerboseInfo(normalizeFdSpecificOption(rawOptions, 'verbose')); logCommand(escapedCommand, verboseInfo, rawOptions); return { command, escapedCommand, startTime, verboseInfo, };};