title: optparse and strings
body: <p>Trying to learn how to use outparse. So here is the situation, I think I got my setup correct its just how to set my options is kinda... confusing me. Basically I just want to check my filename to see if there are specific strings.</p>
  
  <p>For example:</p>
  
  <pre><code>    python script.py -f filename.txt -a hello simple
  </code></pre>
  
  <p>I want it to return something like...</p>
  
  <pre><code>    Reading filename.txt....
      The word, Hello, was found at: Line 10
      The word, simple, was found at: Line 15
  </code></pre>
  
  <p>Here is what I have so far, I just don't know how to set it up correctly. Sorry for asking silly questions :P. Thanks in advance.</p>
  
  <p>Here is the code thus far:</p>
  
  <pre><code>    from optparse import OptionParser
  
      def main():
  
          usage = "useage: %prog [options] arg1 arg2"
          parser = OptionParser(usage)
  
          parser.add_option_group("-a", "--all", action="store", type="string", dest="search_and", help="find ALL lines in the file for the word1 AND word2")
  
          (options, args) = parser.parse_args()
  
          if len(args) != 1:
              parser.error("not enough number of arguments")
  
              #Not sure how to set the options...
  
  
      if __name__ == "__main__":
          main()
  </code></pre>