Permalink
Browse files

Fix issue #38 - Can't set empty indent

  • Loading branch information...
1 parent c6aed91 commit e638b44dc372ea78e91c2686b2ce6b0e8f3bb88e @theseer committed Mar 22, 2013
Showing with 6 additions and 1 deletion.
  1. +3 −1 src/CLI.php
  2. +3 −0 src/Config.php
View
4 src/CLI.php
@@ -162,7 +162,9 @@ private function configure(\ezcConsoleInput $input) {
if ($input->getOption('once')->value) {
$config->setOnceMode(TRUE);
}
- if ($indent = $input->getOption('indent')->value) {
+
+ $indent = $input->getOption('indent')->value;
+ if ($indent !== FALSE) {
$config->setIndent($indent);
}
if ($template = $input->getOption('template')->value) {
View
3 src/Config.php
@@ -114,6 +114,9 @@ public function setIndent($indent) {
public function getIndent() {
if ($this->indent !== NULL) {
+ if (is_numeric($this->indent) && (int)$this->indent == $this->indent) {
+ return str_repeat(' ', (int)$this->indent);
+ }
return $this->indent;
}
if ($this->isStaticMode()) {

0 comments on commit e638b44

Please sign in to comment.