summaryrefslogtreecommitdiff
path: root/src/Script/Input.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Script/Input.php')
-rw-r--r--src/Script/Input.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/Script/Input.php b/src/Script/Input.php
index 6b15c51..4e437dd 100644
--- a/src/Script/Input.php
+++ b/src/Script/Input.php
@@ -19,7 +19,15 @@ class Input
*
* @var string
*/
- protected $availableOptions = 'fdtlc::';
+ protected $shortOpts = 'f:d::t::l::c::';
+
+ protected $longOpts = [
+ 'filename:',
+ 'day::',
+ 'time::',
+ 'location::',
+ 'covers::'
+ ];
/**
* The loaded CLI options
@@ -45,7 +53,7 @@ class Input
*/
protected function loadOptions()
{
- $this->options = getopt($this->getOptionString());
+ $this->options = getopt($this->getShortOptionString(), $this->getLongOptionString());
if (!array_key_exists('f', $this->options)) {
throw new Exception('Filename Option `-f` is required');
@@ -63,9 +71,20 @@ class Input
* @author Phil Burton <phil@pgburton.com>
* @return string
*/
- public function getOptionString(): string
+ public function getShortOptionString(): string
+ {
+ return $this->shortOpts;
+ }
+
+ /**
+ * Return the option string for the options we want to load
+ *
+ * @author Phil Burton <phil@pgburton.com>
+ * @return string
+ */
+ public function getLongOptionString(): array
{
- return $this->availableOptions;
+ return $this->longOpts;
}
/**