Python argparse module usage
<p>I have a program which is called like this:</p>

<pre><code>program.py add|remove|show 
</code></pre>

<p>The problem here is that depending on the add/remove/show command it takes a variable number of arguments, just like this:</p>

<pre><code>program.py add "a string" "another string"
program.py remove "a string"
program.py show
</code></pre>

<p>So, 'add' command would take 2 string arguments, while 'remove' command would take 1 only argument and 'show' command wouldn't take any argument.
I know how to make a basic argument parser using the module argparse, but I don't have much experience with it, so I started from this:</p>

<pre><code>import argparse
parser = argparse.ArgumentParser()
parser.add_argument("command", choices=["add", "remove", "show"])
</code></pre>

<p>But I don't know how to continue and how to implement this functionality depending on the command. Thanks in advance. </p>