title: Using Boolean Flags in Python Click Library (command line arguments)
body: <p>I'm trying to make a verbose flag for my Python program.
  Currently, I'm doing this:</p>
  
  <pre><code>import click
  
  #global variable
  verboseFlag = False
  
  #parse arguments
  @click.command()
  @click.option('--verbose', '-v', is_flag=True, help="Print more output.")
  def log(verbose):
      global verboseFlag
      verboseFlag = True
  
  def main():    
      log()        
      if verboseFlag:
           print("Verbose on!")
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>It'll never print "Verbose on!" even when I set the '-v' argument. My thoughts are that the log function needs a parameter, but what do I give it? Also, is there a way to check whether the verbose flag is on without global variables?</p>