Hwaro::CLI::Commands::Tool::FileGenerator
Shared by the tool platform / tool ci generators: the flag set
and the "print it or write it, refusing to clobber" tail. Keeping
one copy means the two commands cannot disagree on how --force,
-o and --stdout behave.
Constants
FLAGS = [FlagInfo.new(short: "-o", long: "--output", description: "Output file path (default: auto-detected)", takes_value: true, value_hint: "PATH"), FlagInfo.new(short: nil, long: "--stdout", description: "Print to stdout instead of writing file"), FlagInfo.new(short: "-f", long: "--force", description: "Overwrite existing file without warning"), HELP_FLAG]
Instance methods
Print content (stdout_mode) or write it to filename,
refusing to overwrite an existing file unless force.
Whether writing through path lands inside the current project.
The project's own symlink rule: follow links resolving within it
(the common AGENTS.md -> CLAUDE.md), refuse links resolving
outside. A dangling link would create its target, so the chain is
followed hop by hop to where File.write would create the file;
a loop resolves nowhere and is refused.