docs
evals
scenario-1
scenario-10
scenario-2
scenario-3
scenario-4
scenario-5
scenario-6
scenario-7
scenario-8
scenario-9
A command-line tool that processes files with support for options and file paths. The tool should handle both option flags and file paths, including cases where file paths might start with dashes.
--format json file.txt, it reads file.txt and outputs "Processing file.txt with format: json" @test--verbose --format xml data.txt, it reads data.txt and outputs "Verbose mode enabled" followed by "Processing data.txt with format: xml" @test-- --config.json, it treats "--config.json" as a file path (not an option) and outputs "Processing --config.json with format: text" @test--format json -- -output.txt --input.dat, it processes both "-output.txt" and "--input.dat" as file paths with format json @test--format xml -- --verbose file.txt, the "--verbose" is treated as a file path, not an option flag @test/**
* Processes command-line arguments and handles file processing.
* Supports options like --format and --verbose, and correctly handles
* file paths that may start with dashes when preceded by -- escape sequence.
*
* The function should parse command-line arguments, extract options,
* and process all file paths provided (including those after --).
*/
function processFiles() {
// Implementation here
}
module.exports = { processFiles };Provides command-line argument parsing with support for escape sequences.