update configuration example file, fix variable names
[bdrem.git] / src / bdrem / UserInterface.php
index cd9f7024650c9707678d135c4de08f491b1fc154..5fb028b4a964221f884fbd7bd972b6408849f7b3 100644 (file)
@@ -18,7 +18,7 @@ abstract class UserInterface
 
         $arEvents = $source->getEvents(
             $this->config->date,
-            $this->config->daysBefore, $this->config->daysAfter
+            $this->config->daysPrev, $this->config->daysNext
         );
         usort($arEvents, '\\bdrem\\Event::compare');
         $this->render($arEvents);
@@ -31,25 +31,25 @@ abstract class UserInterface
         $parser->version = '0.1.0';
 
         $parser->addOption(
-            'daysAfter',
+            'daysNext',
             array(
-                'short_name'  => '-a',
-                'long_name'   => '--days-after',
+                'short_name'  => '-n',
+                'long_name'   => '--days-next',
                 'description' => 'Show NUM days after date',
                 'help_name'   => 'NUM',
                 'action'      => 'StoreInt',
-                'default'     => $this->config->daysAfter,
+                'default'     => $this->config->daysNext,
             )
         );
         $parser->addOption(
-            'daysBefore',
+            'daysPrev',
             array(
-                'short_name'  => '-b',
-                'long_name'   => '--days-before',
+                'short_name'  => '-p',
+                'long_name'   => '--previous',
                 'description' => 'Show NUM days before date',
                 'help_name'   => 'NUM',
                 'action'      => 'StoreInt',
-                'default'     => $this->config->daysBefore,
+                'default'     => $this->config->daysPrev,
             )
         );
         $parser->addOption(
@@ -86,10 +86,10 @@ abstract class UserInterface
         try {
             $result = $parser->parse();
             // do something with the result object
-            $this->config->daysAfter  = $result->options['daysAfter'];
-            $this->config->daysBefore = $result->options['daysBefore'];
-            $this->config->renderer   = $result->options['renderer'];
-            $this->config->quiet      = $result->options['quiet'];
+            $this->config->daysNext = $result->options['daysNext'];
+            $this->config->daysPrev = $result->options['daysPrev'];
+            $this->config->renderer = $result->options['renderer'];
+            $this->config->quiet    = $result->options['quiet'];
         } catch (\Exception $exc) {
             $this->preRenderParameterError();
             $parser->displayError($exc->getMessage());