-
-
Notifications
You must be signed in to change notification settings - Fork 89
Open
Description
While I'm implementing my plugin https://github.com/llaville/captainhook-bin-plugin to a real project, I run in trouble with context, and I take a time before to understand what was wrong.
I think it will be a good improvement if placeholders (that are already printed) could also display resolved value.
Here is an example of what I will have :
Note
The new resolved part of Placeholder printed line (in VERBOSE mode)
Here is a suggest of patch :
diff --git a/src/Runner/Action/Cli/Command/Formatter.php b/src/Runner/Action/Cli/Command/Formatter.php
index c4f46a9..7b1f309 100644
--- a/src/Runner/Action/Cli/Command/Formatter.php
+++ b/src/Runner/Action/Cli/Command/Formatter.php
@@ -174,13 +174,16 @@ class Formatter
return '';
}
+ $processor = $this->createPlaceholder($placeholder);
+ $resolved = $processor->replacement($options);
+
$this->io->write(
- ' <fg=cyan>Placeholder: ' . $placeholder . '</>' . $this->optionsAsString($options),
+ ' <fg=cyan>Placeholder: ' . $placeholder . '</>' . $this->optionsAsString($options) .
+ ' <fg=cyan>resolved: </>' . $resolved,
true,
IO::VERBOSE
);
- $processor = $this->createPlaceholder($placeholder);
$this->cache($rawPlaceholder, $processor->replacement($options));
}
return $this->cached($rawPlaceholder);
@sebastianfeldmann WDYT ?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels