or run

npx @tessl/cli init
Log in

Version

Files

tile.json

task.mdevals/scenario-3/

File Processor CLI

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.

Capabilities

Process files with options

  • When invoked with --format json file.txt, it reads file.txt and outputs "Processing file.txt with format: json" @test
  • When invoked with --verbose --format xml data.txt, it reads data.txt and outputs "Verbose mode enabled" followed by "Processing data.txt with format: xml" @test

Handle files with dash prefixes

  • When invoked with -- --config.json, it treats "--config.json" as a file path (not an option) and outputs "Processing --config.json with format: text" @test
  • When invoked with --format json -- -output.txt --input.dat, it processes both "-output.txt" and "--input.dat" as file paths with format json @test

Stop option parsing after escape

  • When invoked with --format xml -- --verbose file.txt, the "--verbose" is treated as a file path, not an option flag @test

Implementation

@generates

API

/**
 * 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 };

Dependencies { .dependencies }

cli { .dependency }

Provides command-line argument parsing with support for escape sequences.

@satisfied-by