Skip to content

Commit

Permalink
added: delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
Thijzer committed Sep 19, 2023
1 parent 54d8c9c commit f3f09bc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Command/CompareCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class CompareCommand extends Command
private $master;
private $branch;
private $reference;
private $delimiter;
private $excluded;

public function __construct()
Expand All @@ -28,6 +29,7 @@ public function __construct()
->option('-m --master', 'The master file')
->option('-b --branch', 'The branch file')
->option('-r --reference', 'The identities to align (comma sep)')
->option('-d --delimiter', 'The delimiter (;)', null, ';')
->option('-e --excluded', 'exclude keys you don\'t want to compare (comma sep)')
->usage(
'<bold> compare</end> <comment>--master /path/to/master --branch /path/to/branch --reference code</end> ## detailed<eol/>'.
Expand All @@ -36,16 +38,16 @@ public function __construct()
;
}

public function execute(string $master, string $branch, string $reference, string $excluded = null)
public function execute(string $master, string $branch, string $reference, string $delimiter, string $excluded = null)
{
$io = $this->app()->io();

Assertion::file($master);
Assertion::file($branch);

$compare = new ItemCompare(
CsvParser::create($master, ';'),
CsvParser::create($branch, ';'),
CsvParser::create($master, $delimiter),
CsvParser::create($branch, $delimiter),
array_filter(explode(',', $excluded))
);

Expand Down

0 comments on commit f3f09bc

Please sign in to comment.