Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit d14c977

Browse files
committed
Fix command line automatic comma-split, let it enabled only for -i and -r options, otherwise it can break some commands.
1 parent 31192b6 commit d14c977

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

core/src/core/src/pydio/Core/Http/Cli/Command.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
104104
if(in_array($key, $definitionsKeys)){
105105
if(strpos($key, "cli_") === 0) {
106106
$shortcut = $this->getDefinition()->getOption($key)->getShortcut();
107-
$pydioCliOptions[$shortcut] = FreeArgvOptions::removeEqualsSign($option);
107+
$pydioCliOptions[$shortcut] = $option;
108108
}
109109
}else{
110110
$actionParameters[$key] = $option;

core/src/core/src/pydio/Core/Http/Cli/FreeArgvOptions.php

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,15 @@ public function __construct($argv = array()){
5858
parent::__construct($_SERVER["argv"]);
5959
}
6060

61+
/**
62+
* Decides wether we should split an option value by commas
63+
* @param $key
64+
* @return bool
65+
*/
66+
protected function fieldSupportCommaSplit($key){
67+
return in_array($key, ["cli_repository_id", "cli_impersonate"]);
68+
}
69+
6170
/**
6271
* @return array
6372
*/
@@ -66,8 +75,12 @@ public function getOptions()
6675
if(!isSet($this->freeParsed)){
6776
$options = parent::getOptions();
6877
foreach ($options as $key => $value) {
69-
$options[$key] = self::removeEqualsSign($value);
70-
$options[$key] = $this->splitByComma($value);
78+
$value = self::removeEqualsSign($value);
79+
if($this->fieldSupportCommaSplit($key)){
80+
$options[$key] = $this->splitByComma($value);
81+
}else{
82+
$options[$key] = $value;
83+
}
7184
}
7285
$this->freeParsed = $options;
7386
}

0 commit comments

Comments
 (0)