title: python argparse set behaviour when no arguments provided
body: <p>I'm fairly new to python and I'm stuck on how to structure my simple script when using command line arguments.</p>
  
  <p>The purpose of the script is to automate some daily tasks in my job relating to sorting and manipulating images. </p>
  
  <p>I can specify the arguments and get them to call the relevant functions, but i also want to set a default action when no arguments are supplied.</p>
  
  <p>Here's my current structure.</p>
  
  <pre><code>parser = argparse.ArgumentParser()
  parser.add_argument("-l", "--list", help="Create CSV of images", action="store_true")
  parser.add_argument("-d", "--dimensions", help="Copy images with incorrect dimensions to new directory", action="store_true")
  parser.add_argument("-i", "--interactive", help="Run script in interactive mode", action="store_true")
  args = parser.parse_args()
  
  if args.list:
      func1()
  if args.interactive:
      func2()
  if args.dimensions:
      func3()
  </code></pre>
  
  <p>But when I supply no arguments nothing will be called.</p>
  
  <pre><code>Namespace(dimensions=False, interactive=False, list=False)
  </code></pre>
  
  <p>What i want is some default behaviour if no arguements are supplied</p>
  
  <pre><code>if args.list:
          func1()
      if args.interactive:
          func2()
      if args.dimensions:
          func3()
      if no args supplied:
          func1()
          func2()
          func3()
  </code></pre>
  
  <p>This seems like it should be fairly easy to achieve but I'm lost on the logic of how to detect all arguments are false without looping through the arguments and testing if all are false.</p>
  
  <h2>Update</h2>
  
  <p>Multiple arguments are valid together, that is why I didn't go down the elif route.</p>
  
  <h2>Update 2</h2>
  
  <p>Here is my updated code taking into account the answer from  @unutbu</p>
  
  <p>it doesn't seem ideal as everything is wrapped in an if statement but in the short term i couldn't find a better solution. I'm happy to accept the answer from @unutbu, any other improvements offered would be appreciated.</p>
  
  <pre><code>lists = analyseImages()
      if lists:
          statusTable(lists)
  
          createCsvPartial = partial(createCsv, lists['file_list'])
          controlInputParital = partial(controlInput, lists)
          resizeImagePartial = partial(resizeImage, lists['resized'])
          optimiseImagePartial = partial(optimiseImage, lists['size_issues'])
          dimensionIssuesPartial = partial(dimensionIssues, lists['dim_issues'])
  
          parser = argparse.ArgumentParser()
          parser.add_argument(
          "-l", "--list", 
          dest='funcs', action="append_const", const=createCsvPartial,
          help="Create CSV of images",)
          parser.add_argument(
          "-c", "--convert", 
          dest='funcs', action="append_const", const=resizeImagePartial,
          help="Convert images from 1500 x 2000px to 900 x 1200px ",)
          parser.add_argument(
          "-o", "--optimise", 
          dest='funcs', action="append_const", const=optimiseImagePartial,    
          help="Optimise filesize for 900 x 1200px images",)
          parser.add_argument(
          "-d", "--dimensions", 
          dest='funcs', action="append_const", const=dimensionIssuesPartial,
          help="Copy images with incorrect dimensions to new directory",)
          parser.add_argument(
          "-i", "--interactive", 
          dest='funcs', action="append_const", const=controlInputParital,
          help="Run script in interactive mode",)
          args = parser.parse_args()
  
          if not args.funcs:
              args.funcs = [createCsvPartial, resizeImagePartial, optimiseImagePartial, dimensionIssuesPartial]
  
          for func in args.funcs:
              func()
  
      else:
          print 'No jpegs found'
  </code></pre>