Skip to content

Commit 660a476

Browse files
committed
optional command value with ?
1 parent 654da4e commit 660a476

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Ubiquity/devtools/cmd/Command.php

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ public static function newAction() {
389389
}
390390

391391
public static function infoModel() {
392-
return new Command("info:model", "infoType", "Returns the model meta datas.", [
392+
return new Command("info:model", "?infoType", "Returns the model meta datas.", [
393393
"info-model"
394394
], [
395395
"s" => Parameter::create("separate", "If true, returns each info in a separate table", [
@@ -417,7 +417,7 @@ public static function infoModels() {
417417
}
418418

419419
public static function infoValidation() {
420-
return new Command("info:validation", "memberName", "Returns the models validation info.", [
420+
return new Command("info:validation", "?memberName", "Returns the models validation info.", [
421421
"info-validation",
422422
"info:validators",
423423
"info-validators"
@@ -665,9 +665,16 @@ public function getDescription() {
665665
* @return mixed
666666
*/
667667
public function getValue() {
668+
if ($this->value != null) {
669+
return ltrim($this->value, '?');
670+
}
668671
return $this->value;
669672
}
670673

674+
public function hasRequiredValue() {
675+
return $this->value != null && \substr($this->value, 0, 1) !== '?';
676+
}
677+
671678
/**
672679
*
673680
* @return mixed

0 commit comments

Comments
 (0)