Accepting both options and positional arguments for the same purpose
does not look like a good idea to me.
Anyway, here is a solution using plac (http://pypi.python.org/pypi/
plac) assuming you can afford an external dependency:
import plac
@plac.annotations(
personname=("person to be matched
g positional arguments in a predefined order
> ie,
> findmatch -f schoolmates -i jon -t 3.5 -n 115
> or
> findmatch jon schoolmates 115 3.5
>
> I tried to code this using optparser..
>
> def parse_arguments():
> usage = """usage: %prog [opt
g positional arguments in a predefined order
> ie,
> findmatch -f schoolmates -i jon -t 3.5 -n 115
> or
> findmatch jon schoolmates 115 3.5
>
> I tried to code this using optparser..
>
> def parse_arguments():
> usage = """usage: %prog [opt
3.5 -n 115
or
findmatch jon schoolmates 115 3.5
I tried to code this using optparser..
def parse_arguments():
usage = """usage: %prog [options]
eg:
findmatch -i jon -f schoolmates -n 115 -t 3.5
"""
parser = OptionParser(usage)
parser.a