Question: From the OPTPARSE library reference:

```
option_list = [
    make_option("-f", "--filename",
                action="store", type="string", dest="filename"),
    make_option("-q", "--quiet",
                action="store_false", dest="verbose"),
    ]

parser = OptionParser(option_list=option_list)

```

---

Like the above example, I want to make a option list using make\_option and pass it to a decorator which instantiates the parser and adds the arguments. 

How can this be achieved in argparse? Is there a way to populate the parser other than parse\_args()?

Answer: 
You can give `argparse.ArgumentParser` a list of [parent parsers](http://docs.python.org/2.7/library/argparse.html#parents):

```
parent = argparse.ArgumentParser(add_help=False)
parent.add_argument('-f','--filename')
parent.add_argument('-q','--quiet',action='store_false',dest='verbose')

parser = argparse.ArgumentParser(parents=[parent])
...
namespace = parser.parse_args()

```
```
def process_args():
    parser = argparse.ArgumentParser()
    parser.add_argument('-f', '--filename', dest='filename', type=string, action='store')
    args = parser.parse_args()
    return args

if __name__ == '__main__':
    args = process_args()

```