8000 Renamed argument 'description' to 'name'. · kler/getopt-php@3743fc6 · GitHub
[go: up one dir, main page]

Skip to content

Commit 3743fc6

Browse files
committed
Renamed argument 'description' to 'name'.
1 parent 26ee0cd commit 3743fc6

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

src/Ulrichsg/Getopt/Argument.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Argument
99
/** @var callable */
1010
private $validation;
1111
/** @var string */
12-
private $description;
12+
private $name;
1313

1414
/**
1515
* Creates a new argument.
@@ -18,15 +18,15 @@ class Argument
1818
* @param callable|null $validation a validation function (optional)
1919
* @throws \InvalidArgumentException
2020
*/
21-
public function __construct($default = null, $validation = null, $description = "arg")
21+
public function __construct($default = null, $validation = null, $name = "arg")
2222
{
2323
if (!is_null($default)) {
2424
$this->setDefaultValue($default);
2525
}
2626
if (!is_null($validation)) {
2727
$this->setValidation($validation);
2828
}
29-
$this->description = $description;
29+
$this->name = $name;
3030
}
3131

3232
/**
@@ -104,12 +104,12 @@ public function getDefaultValue()
104104
}
105105

106106
/**
107-
* Retrieve the descriptopm
107+
* Retrieve the argument name
108108
*
109109
* @return string
110110
*/
111-
public function getDescription()
111+
public function getName()
112112
{
113-
return $this->description;
113+
return $this->name;
114114
}
115-
}
115+
}

src/Ulrichsg/Getopt/Getopt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ public function getHelpText($padding = 25)
225225
$mode = '';
226226
break;
227227
case self::REQUIRED_ARGUMENT:
228-
$mode = "<".$option->getArgument()->getDescription().">";
228+
$mode = "<".$option->getArgument()->getName().">";
229229
break;
230230
case self::OPTIONAL_ARGUMENT:
231-
$mode = "[<".$option->getArgument()->getDescription().">]";
231+
$mode = "[<".$option->getArgument()->getName().">]";
232232
break;
233233
}
234234
$short = ($option->short()) ? '-'.$option->short() : '';

0 commit comments

Comments
 (0)
0