readme: info on cursors activation and minor corrections
[oscopy/ivan.git] / oscopy_app.py
blobeb22e2a2cd2bcca4aaef110dc93c983ede999f8d
1 #!/usr/bin/python
2 """
3 Sample command line application
4 """
5 import oscopy
6 from optparse import OptionParser
9 if __name__ == "__main__":
10 # Parse command line arguments
11 # Current options:
12 # -b : batch mode, read commands from file
13 # -i : interactive mode, do not quit at the end of batch file
14 # -q : do not display startup message
15 parser = OptionParser()
16 parser.add_option("-b", "--batch", dest="fn",\
17 help="Execute commands in FILE then exit",\
18 metavar="FILE")
19 parser.add_option("-i", "--interactive", action="store_true",\
20 dest="inter",\
21 help="Go to interactive mode after executing batch file")
22 parser.add_option("-q", "--quiet", action="store_true",\
23 dest="quiet",\
24 help="Do not display startup message")
25 (options, args) = parser.parse_args()
27 o = oscopy.OscopyApp()
28 # do_Exec(filename)
29 if options.fn is not None:
30 o.do_exec(options.fn)
31 if options.inter:
32 if options.quiet:
33 o.cmdloop("")
34 else:
35 o.cmdloop()
36 else:
37 if options.quiet:
38 o.cmdloop("")
39 else:
40 o.cmdloop()