summaryrefslogtreecommitdiff
path: root/examples/cli
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-03-01 23:37:42 +0200
committerPaul Buetow <paul@buetow.org>2026-03-01 23:37:42 +0200
commit211e3650387bd299bfcc6d21b7230323e45217c2 (patch)
treefa0a8ba47074f3286a88db7256812ade3adf4dcf /examples/cli
parent1ef38a857c895e5f970d219ba6802b2627801620 (diff)
refactor: defer Options parsing — add explicit Options.parse! method
Parsing ARGV at module eval time (during require) is fragile: it runs before the application is ready, can pick up test-runner flags, and bleeds stale values across repeated configure calls in tests. Move the OptionParser setup and ARGV slicing into Options.parse!. The module body now only sets safe defaults. parse! resets to defaults before each parse so state cannot accumulate across calls. Call Options.parse! once at the top of configure() in dsl.rb so all entry points (scripts, Rake tasks) still receive parsed options without any caller needing to know about the details. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Diffstat (limited to 'examples/cli')
0 files changed, 0 insertions, 0 deletions