title: Is there any built-in package for a command-line interpreter in golang?
body: <p>I would like to create command-line tool like <code>git</code>, <code>go</code> or <code>aws</code> in which we will pass some sub-commands to the main command and the last sub-command could also have some flags. Some examples are:</p>
  
  <pre><code>git add &lt;file&gt;
  go build &lt;file&gt;
  aws s3 cp --recursive &lt;src&gt; &lt;dest&gt;
  </code></pre>
  
  <p>Here are some examples of my hypothetical tool:</p>
  
  <pre><code>mytool cmd1
  mytool cmd2 -f &lt;path&gt;
  mytool cmd3 -f1 -f2 value --flag3 &lt;path&gt;
  </code></pre>
  
  <p>I know we can use the <code>fmt</code> package for defining and parsing flags, but I don't know if this package gives me the feature I described above or not. I was wondering if there is any built-in package for doing so?</p>