Files
cligen/docs/CliGen/App.html
2026-08-09 15:20:06 -05:00

452 lines
11 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="generator" content="Crystal Docs 1.20.3">
<meta name="crystal_docs.project_version" content="object_rework-dev">
<meta name="crystal_docs.project_name" content="CliGenerator">
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/doc.js"></script>
<meta name="repository-name" content="CliGenerator">
<title>CliGen::App - CliGenerator object_rework-dev</title>
<script type="text/javascript">
CrystalDocs.base_path = "../";
</script>
</head>
<body>
<svg class="hidden">
<symbol id="octicon-link" viewBox="0 0 16 16">
<path fill="currentColor" fill-rule="evenodd" d="M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z"></path>
</symbol>
</svg>
<input type="checkbox" id="sidebar-btn">
<label for="sidebar-btn" id="sidebar-btn-label">
<svg class="open" xmlns="http://www.w3.org/2000/svg" height="2em" width="2em" viewBox="0 0 512 512"><title>Open Sidebar</title><path fill="currentColor" d="M80 96v64h352V96H80zm0 112v64h352v-64H80zm0 112v64h352v-64H80z"></path></svg>
<svg class="close" xmlns="http://www.w3.org/2000/svg" width="2em" height="2em" viewBox="0 0 512 512"><title>Close Sidebar</title><path fill="currentColor" d="m118.6 73.4-45.2 45.2L210.7 256 73.4 393.4l45.2 45.2L256 301.3l137.4 137.3 45.2-45.2L301.3 256l137.3-137.4-45.2-45.2L256 210.7Z"></path></svg>
</label>
<div class="sidebar">
<div class="sidebar-header">
<div class="search-box">
<input type="search" class="search-input" placeholder="Search..." spellcheck="false" aria-label="Search">
</div>
<div class="project-summary">
<h1 class="project-name">
<a href="../index.html">
CliGenerator
</a>
</h1>
<span class="project-version">
object_rework-dev
</span>
</div>
</div>
<div class="search-results hidden">
<ul class="search-list"></ul>
</div>
<div class="types-list">
<ul>
<li class="parent open current" data-id="CliGenerator/CliGen" data-name="cligen">
<a href="../CliGen.html">CliGen</a>
<ul>
<li class=" " data-id="CliGenerator/CliGen/AdditionalDefaultFlag" data-name="cligen::additionaldefaultflag">
<a href="../CliGen/AdditionalDefaultFlag.html">AdditionalDefaultFlag</a>
</li>
<li class=" current" data-id="CliGenerator/CliGen/App" data-name="cligen::app">
<a href="../CliGen/App.html">App</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Arg" data-name="cligen::arg">
<a href="../CliGen/Arg.html">Arg</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Argument" data-name="cligen::argument">
<a href="../CliGen/Argument.html">Argument</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/BaseFlag" data-name="cligen::baseflag">
<a href="../CliGen/BaseFlag.html">BaseFlag</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Command" data-name="cligen::command">
<a href="../CliGen/Command.html">Command</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/CommandInfo" data-name="cligen::commandinfo">
<a href="../CliGen/CommandInfo.html">CommandInfo</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/CommandNode" data-name="cligen::commandnode">
<a href="../CliGen/CommandNode.html">CommandNode</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/DefaultFlag" data-name="cligen::defaultflag">
<a href="../CliGen/DefaultFlag.html">DefaultFlag</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Flag" data-name="cligen::flag(t)">
<a href="../CliGen/Flag.html">Flag</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Format" data-name="cligen::format">
<a href="../CliGen/Format.html">Format</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/MatchType" data-name="cligen::matchtype">
<a href="../CliGen/MatchType.html">MatchType</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/ProxyCommand" data-name="cligen::proxycommand">
<a href="../CliGen/ProxyCommand.html">ProxyCommand</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Regex" data-name="cligen::regex">
<a href="../CliGen/Regex.html">Regex</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Selection" data-name="cligen::selection">
<a href="../CliGen/Selection.html">Selection</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/SubCommand" data-name="cligen::subcommand">
<a href="../CliGen/SubCommand.html">SubCommand</a>
</li>
<li class=" " data-id="CliGenerator/CliGen/Trigger" data-name="cligen::trigger">
<a href="../CliGen/Trigger.html">Trigger</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="main-content">
<h1 class="type-name">
<span class="kind">
class
</span> CliGen::<wbr>App
</h1>
<ul class="superclass-hierarchy"><li class="superclass"><a href="../CliGen/App.html">CliGen::App</a></li><li class="superclass"><a href="../CliGen/CommandNode.html">CliGen::CommandNode</a></li><li class="superclass">Reference</li><li class="superclass">Object</li></ul>
<h2>
<a id="overview" class="anchor" href="#overview">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Overview
</h2>
<p>This serves as the default App object, that holds a copy of all flags &amp;
handles flag processing until it hands off to the user defined commands</p>
<h2>
<a id="defined-in" class="anchor" href="#defined-in">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Defined in:
</h2>
cligen/app.cr
<br/>
<h2>
<a id="constructors" class="anchor" href="#constructors">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Constructors
</h2>
<ul class="list-summary">
<li class="entry-summary">
<a href="#new%28name%2Cflags%2Ccommands%2Cpre_run_commands%2Cpost_run_commands%29-class-method" class="signature"><strong>.new</strong>(name, flags, commands, pre_run_commands, post_run_commands)</a>
</li>
</ul>
<h2>
<a id="class-method-summary" class="anchor" href="#class-method-summary">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Class Method Summary
</h2>
<ul class="list-summary">
<li class="entry-summary">
<a href="#process%28args%3AArray%28String%29%3DARGV%29-class-method" class="signature"><strong>.process</strong>(args : Array(String) = <span class="t">ARGV</span>)</a>
<div class="summary"><p>Serves as a convinence method for the user to call to begin processing an argument array provided by the user.</p></div>
</li>
</ul>
<h2>
<a id="instance-method-summary" class="anchor" href="#instance-method-summary">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Instance Method Summary
</h2>
<ul class="list-summary">
<li class="entry-summary">
<a href="#check%21-instance-method" class="signature"><strong>#check!</strong></a>
</li>
</ul>
<div class="methods-inherited">
<h3>Instance methods inherited from class <code><a href="../CliGen/CommandNode.html">CliGen::CommandNode</a></code></h3>
<a href="../CliGen/CommandNode.html#check%21-instance-method" class="tooltip">
<span>check!</span>
check!</a>,
<a href="../CliGen/CommandNode.html#check_for_duplicates%21%28flags%3AArray%28BaseFlag%29%29-instance-method" class="tooltip">
<span>check_for_duplicates!(flags : Array(BaseFlag))</span>
check_for_duplicates!</a>,
<a href="../CliGen/CommandNode.html#find_match%28arg%3AString%29-instance-method" class="tooltip">
<span>find_match(arg : String)</span>
find_match</a>,
<a href="../CliGen/CommandNode.html#process%28args%3AArray%28String%29%29-instance-method" class="tooltip">
<span>process(args : Array(String))<br/>process(args : Array(Arg)) : Nil</span>
process</a>
<h3>Constructor methods inherited from class <code><a href="../CliGen/CommandNode.html">CliGen::CommandNode</a></code></h3>
<a href="../CliGen/CommandNode.html#new%28name%3AString%2Cflags%3AArray%28CliGen%3A%3ABaseFlag%29%2Ccommands%3AArray%28CliGen%3A%3ACommandNode%29%2Cpre_run_commands%3AArray%28_%29%2Cpost_run_commands%3AArray%28_%29%29-class-method" class="tooltip">
<span>new(name : String, flags : Array(CliGen::BaseFlag), commands : Array(CliGen::CommandNode), pre_run_commands : Array(_), post_run_commands : Array(_))</span>
new</a>
</div>
<h2>
<a id="constructor-detail" class="anchor" href="#constructor-detail">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Constructor Detail
</h2>
<div class="entry-detail" id="new(name,flags,commands,pre_run_commands,post_run_commands)-class-method">
<div class="signature">
def self.<strong>new</strong>(name, flags, commands, pre_run_commands, post_run_commands)
<a class="method-permalink" href="#new%28name%2Cflags%2Ccommands%2Cpre_run_commands%2Cpost_run_commands%29-class-method">#</a>
</div>
<br/>
<div>
</div>
</div>
<h2>
<a id="class-method-detail" class="anchor" href="#class-method-detail">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Class Method Detail
</h2>
<div class="entry-detail" id="process(args:Array(String)=ARGV)-class-method">
<div class="signature">
def self.<strong>process</strong>(args : Array(String) = <span class="t">ARGV</span>)
<a class="method-permalink" href="#process%28args%3AArray%28String%29%3DARGV%29-class-method">#</a>
</div>
<div class="doc">
<p>Serves as a convinence method for the user to call to begin processing an
argument array provided by the user.</p>
<p>This defaults to ARGV for convinence if no arguments are passed through</p>
</div>
<br/>
<div>
</div>
</div>
<h2>
<a id="instance-method-detail" class="anchor" href="#instance-method-detail">
<svg class="octicon-link" aria-hidden="true">
<use href="#octicon-link"/>
</svg>
</a>
Instance Method Detail
</h2>
<div class="entry-detail" id="check!-instance-method">
<div class="signature">
def <strong>check!</strong>
<a class="method-permalink" href="#check%21-instance-method">#</a>
</div>
<br/>
<div>
</div>
</div>
</div>
</body>
</html>