<p dir="auto"><code class="notranslate">test.js</code></p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="#!/usr/bin/env deno

console.log(Deno.args);"><pre class="notranslate">#!/usr/bin/env deno

<span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-v">Deno</span><span class="pl-kos">.</span><span class="pl-c1">args</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt; ./test.js -B
[ &quot;./test.js&quot;, &quot;-B&quot; ]"><pre class="notranslate"><span class="pl-k">&gt;</span> ./test.js -B
[ <span class="pl-s"><span class="pl-pds">"</span>./test.js<span class="pl-pds">"</span></span>, <span class="pl-s"><span class="pl-pds">"</span>-B<span class="pl-pds">"</span></span> ]</pre></div>
<div class="highlight highlight-source-shell notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="&gt; ./test.js -A
[ &quot;./test.js&quot; ]"><pre class="notranslate"><span class="pl-k">&gt;</span> ./test.js -A
[ <span class="pl-s"><span class="pl-pds">"</span>./test.js<span class="pl-pds">"</span></span> ]</pre></div>
<h3 dir="auto">Description</h3>
<p dir="auto">As a developer, I would like to be able to consume the <code class="notranslate">-v</code> or <code class="notranslate">--version</code> flags in my application. I'd prefer that if a script is provided, Deno ignore the version flag and instead pass it on to <code class="notranslate">Deno.args</code>. Currently if I run a script with either flag, Deno prints out its internal version information as if I had run</p>
<ul dir="auto">
<li><code class="notranslate">deno version</code></li>
<li><code class="notranslate">deno --version</code></li>
<li><code class="notranslate">deno -v</code></li>
</ul>
<h3 dir="auto">Steps to Reproduce</h3>
<ol dir="auto">
<li>Create a file <code class="notranslate">test.ts</code> containing the following code</li>
</ol>
<div class="highlight highlight-source-ts notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="console.log(Deno.args);"><pre class="notranslate"><span class="pl-smi">console</span><span class="pl-kos">.</span><span class="pl-en">log</span><span class="pl-kos">(</span><span class="pl-smi">Deno</span><span class="pl-kos">.</span><span class="pl-c1">args</span><span class="pl-kos">)</span><span class="pl-kos">;</span></pre></div>
<ol start="2" dir="auto">
<li>Run <code class="notranslate">deno test.ts</code> or <code class="notranslate">deno run test.ts</code></li>
<li>Observe the program runs successfully and prints out: <code class="notranslate">[ "test.ts" ]</code></li>
<li>Run any of the following...</li>
</ol>
<ul dir="auto">
<li><code class="notranslate">deno test.ts --version</code></li>
<li><code class="notranslate">deno test.ts -v</code></li>
<li><code class="notranslate">deno run test.ts --version</code></li>
<li><code class="notranslate">deno run test.ts -v</code></li>
</ul>
<ol start="5" dir="auto">
<li>Observe the program never runs, deno instead prints out its internal version information</li>
</ol>
<h3 dir="auto">Additional Context</h3>
<ul dir="auto">
<li>Deno version: 0.15.0</li>
<li>OS: Windows 10 v1903</li>
</ul>