Analyzer::Haskell::Cli
Inherits CliEndpointSupport < Analyzer < FileHelper < Reference < Object
Surfaces the command-line attack surface of Haskell programs as cli://
endpoints: optparse-applicative (long/argument/command), turtle
(Turtle.Options: optText/optInt/optPath/switch/arg/argText) plus getEnv
reads. Line-scan, merged by URL.
Constants
Per-path test-file gate. A precompiled Regex.union (PCRE2 JIT)
replaces the two OR-ed String#includes? scans it used to run --
provably equivalent since union auto-escapes each literal, and a
single regex pass over lower is cheaper than two substring scans.
argText plus the type-suffixed positional combinators, mirroring the TURTLE_OPT alternation above.
arg (the generic reader-based combinator) is an even more common bare
word than switch (ordinary local variables/parameters are routinely
named arg). Real usage is always arg <reader> "name" "desc": the
reader is an identifier/qualified-name or a parenthesized expression,
and BOTH the name and description string literals are required -- a
stray f arg x "str" call/comment only has one trailing string and
won't match.
Turtle re-exports Turtle.Options from the top-level Turtle module,
which is used pervasively for plain shell scripting too, so gate on
either the qualified submodule import or an explicit options name
in the unqualified import list, never a bare import Turtle.
Turtle.Options: optText/optInt/optPath/... and switch take the flag
name as their own first quoted argument (no long "..." wrapper),
so these need dedicated regexes distinct from LONG above.
switch is a bare, extremely common Haskell identifier (also used by
optparse-applicative itself, and as a plain string-pattern dispatch
function). Real Turtle usage is always the full 3-argument shape
switch "name" 'c' "desc"; require the trailing short-char + description
so we don't fire on unrelated switch "x" = ... equations.
Class methods
Instance methods
Instance-side view of the same declaration. The per-file rescues live on
this base class, which has no way to name the analyzer that is running
inside them, so a skipped file could not be attributed to a tech.
Deriving it from analyzer_for keeps the name written exactly once.