summaryrefslogtreecommitdiff
path: root/modules/language/python/module/test2.py
blob: 0d59a6cfa39498a11badf9000b3ba0c1137a680a (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
module(test2)
from optparse import OptionParser

def f(args):
    parser = OptionParser(usage="usage: %prog [options] filename",
                          version="%prog 1.0")

    parser.add_option("-x", "--xhtml",
                      action="store_true",
                      dest="xhtml_flag",
                      default=False,
                      help="create a XHTML template instead of HTML")

    parser.add_option("-c", "--cssfile",
                      action="store", # optional because action defaults to "store"
                      dest="cssfile",
                      default="style.css",
                      help="CSS file to link")

    (options, args) = parser.parse_args(args)

    if len(args) != 1:
        parser.error("wrong number of arguments")

    print(options)
    print(args)

__all__=['f']