From d425060816a18ac4ef9203ee02e82eb4e8443a38 Mon Sep 17 00:00:00 2001 From: Marco Roth Date: Fri, 27 Feb 2026 16:15:54 +0100 Subject: [PATCH] Ruby CLI: Expose `--no-analyze` and `--track-whitespace` options --- lib/herb/cli.rb | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/herb/cli.rb b/lib/herb/cli.rb index 376445b41..d5357cf7e 100644 --- a/lib/herb/cli.rb +++ b/lib/herb/cli.rb @@ -8,7 +8,7 @@ class Herb::CLI include Herb::Colors - attr_accessor :json, :silent, :no_interactive, :no_log_file, :no_timing, :local, :escape, :no_escape, :freeze, :debug, :tool, :strict + attr_accessor :json, :silent, :no_interactive, :no_log_file, :no_timing, :local, :escape, :no_escape, :freeze, :debug, :tool, :strict, :analyze, :track_whitespace def initialize(args) @args = args @@ -144,7 +144,7 @@ def result show_config exit(0) when "parse" - Herb.parse(file_content, strict: strict.nil? || strict) + Herb.parse(file_content, strict: strict.nil? || strict, analyze: analyze.nil? || analyze, track_whitespace: track_whitespace || false) when "compile" compile_template when "render" @@ -261,6 +261,18 @@ def option_parser self.strict = false end + parser.on("--analyze", "Enable analyze mode (for parse command) (default: true)") do + self.analyze = true + end + + parser.on("--no-analyze", "Disable analyze mode (for parse command)") do + self.analyze = false + end + + parser.on("--track-whitespace", "Enable whitespace tracking (for parse command) (default: false)") do + self.track_whitespace = true + end + parser.on("--tool TOOL", "Show config for specific tool: linter, formatter (for config command)") do |t| self.tool = t.to_sym end