title: How to implement the --verbose or -v option into a script?
body: <p>I know the <code>--verbose</code> or <code>-v</code> from several tools and I'd like to implement this into some of my own scripts and tools.</p>
  
  <p>I thought of placing:</p>
  
  <pre><code>if verbose:
      print ...
  </code></pre>
  
  <p>through my source code, so that if a user passes the <code>-v</code> option, the variable <code>verbose</code> will be set to <code>True</code> and the text will be printed.</p>
  
  <p>Is this the right approach or is there a more common way?</p>
  
  <p>Addition: I am not asking for a way to implement the parsing of arguments. That I know how it is done. I am only interested specially in the verbose option.</p>