summaryrefslogtreecommitdiff
path: root/scripts/ldtp
blob: 91ad6aef1da68b1782d2d62d37ca119b3ec02ee8 (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/env python
"""
LDTP v2 ldtp executable

@author: Nagappan Alagappan <nagappan@gmail.com>
@copyright: Copyright (c) 2009-12 Nagappan Alagappan
@license: LGPL

http://ldtp.freedesktop.org

This file may be distributed and/or modified under the terms of the GNU Lesser General
Public License version 2 as published by the Free Software Foundation. This file
is distributed without any warranty; without even the implied warranty of 
merchantability or fitness for a particular purpose.

See 'COPYING' in the source distribution for more information.

Headers in this file shall remain intact.
"""

import os
import sys
import ldtpd
from optparse import OptionParser

def parse_cmd_line_option():
   usage = "usage: %prog [options]"
   parser = OptionParser(usage)
   parser.add_option("-V", "--version", dest = "version",
                     action = "store_true", help = "LDTP engine version",
                     default = False)
   parser.add_option("-v", "--verbose", dest = "verbose",
                     action = "store_true", help = "Verbose mode",
                     default = False)

   (options, args) = parser.parse_args()
   if options.version:
      # Print version info and exit
      print 'ldtp-3.0.0'
      sys.exit(0)
   if options.verbose:
      # Set verbose flag
      os.environ['LDTP_DEBUG'] = '2'

parse_cmd_line_option()
try:
   ldtpd.main()
except KeyboardInterrupt:
   pass