title: myscript.py: error: unrecognized arguments
body: <p>I seem to be having an issue with a program I am working on in python. I have tried using sys.argv, getopt and now argparse and I am still having the same issues. Whenever I try to call myscript.py from the command line with any working arguments, the program appears to start up then it just exits the code and prints the following in the command line:</p>
  
  <pre><code>Loading configurations...                        &lt;---- indicates program is starting
  usage: myprogram.py [-h] [-c string] [-v]
  miner.py: error: unrecognized arguments: -i 0 -d 0
  </code></pre>
  
  <h2>myprogram.py snippet</h2>
  
  
  
  <pre class="lang-py prettyprint-override"><code>import argparse
  
  parser = argparse.ArgumentParser()
  parser.add_argument('-i','--interval', action="store", type=int, dest='interval',help='Amount of time between each switch in seconds.')
  parser.add_argument('-d','--donate', action="store", type=int,dest='donate',help='Amount of time to donate your mining rig in percentage per hour.')
  
  results = parser.parse_args()
  
  class globalbavars:
      if len(sys.argv) == 1:
          interval = 8
          donate = 1
  
      interval = results.interval
      donate = results.donate
  </code></pre>
  
  <p>I usually almost always figure out issues with my program on my own through fierce debugging but this one legitimately has me scratching my head. I can't figure out what is causing this issue. I don't even think that it's an issue with my code considering I've tried parsing with sys.argv, get opt and argparse and got the same results. Can someone help me out?</p>