comparison mxtool/mx.py @ 11401:2d228d304247

minor improvements/cleanups to mx (CR-1313)
author Doug Simon <doug.simon@oracle.com>
date Fri, 23 Aug 2013 16:35:46 +0200
parents 9cdf7a9d3475
children 3110bea9a6b0
comparison
equal deleted inserted replaced
11400:37446655527c 11401:2d228d304247
945 self.add_argument('--cp-sfx', dest='cp_suffix', help='class path suffix', metavar='<arg>') 945 self.add_argument('--cp-sfx', dest='cp_suffix', help='class path suffix', metavar='<arg>')
946 self.add_argument('--J', dest='java_args', help='Java VM arguments (e.g. --J @-dsa)', metavar='@<args>', default=DEFAULT_JAVA_ARGS) 946 self.add_argument('--J', dest='java_args', help='Java VM arguments (e.g. --J @-dsa)', metavar='@<args>', default=DEFAULT_JAVA_ARGS)
947 self.add_argument('--Jp', action='append', dest='java_args_pfx', help='prefix Java VM arguments (e.g. --Jp @-dsa)', metavar='@<args>', default=[]) 947 self.add_argument('--Jp', action='append', dest='java_args_pfx', help='prefix Java VM arguments (e.g. --Jp @-dsa)', metavar='@<args>', default=[])
948 self.add_argument('--Ja', action='append', dest='java_args_sfx', help='suffix Java VM arguments (e.g. --Ja @-dsa)', metavar='@<args>', default=[]) 948 self.add_argument('--Ja', action='append', dest='java_args_sfx', help='suffix Java VM arguments (e.g. --Ja @-dsa)', metavar='@<args>', default=[])
949 self.add_argument('--user-home', help='users home directory', metavar='<path>', default=os.path.expanduser('~')) 949 self.add_argument('--user-home', help='users home directory', metavar='<path>', default=os.path.expanduser('~'))
950 self.add_argument('--java-home', help='JDK installation directory (must be JDK 6 or later)', metavar='<path>') 950 self.add_argument('--java-home', help='bootstrap JDK installation directory (must be JDK 6 or later)', metavar='<path>')
951 self.add_argument('--ignore-project', action='append', dest='ignored_projects', help='name of project to ignore', metavar='<name>', default=[]) 951 self.add_argument('--ignore-project', action='append', dest='ignored_projects', help='name of project to ignore', metavar='<name>', default=[])
952 if get_os() != 'windows': 952 if get_os() != 'windows':
953 # Time outs are (currently) implemented with Unix specific functionality 953 # Time outs are (currently) implemented with Unix specific functionality
954 self.add_argument('--timeout', help='Timeout (in seconds) for command', type=int, default=0, metavar='<secs>') 954 self.add_argument('--timeout', help='timeout (in seconds) for command', type=int, default=0, metavar='<secs>')
955 self.add_argument('--ptimeout', help='Timeout (in seconds) for subprocesses', type=int, default=0, metavar='<secs>') 955 self.add_argument('--ptimeout', help='timeout (in seconds) for subprocesses', type=int, default=0, metavar='<secs>')
956 956
957 def _parse_cmd_line(self, args=None): 957 def _parse_cmd_line(self, args=None):
958 if args is None: 958 if args is None:
959 args = sys.argv[1:] 959 args = sys.argv[1:]
960 960
1153 """ 1153 """
1154 if get_os() == 'windows': 1154 if get_os() == 'windows':
1155 return name + '.exe' 1155 return name + '.exe'
1156 return name 1156 return name
1157 1157
1158 def lib_suffix(name): 1158 def add_lib_prefix(name):
1159 """ 1159 """
1160 Gets the platform specific suffix for a library 1160 Adds the platform specific library prefix to a name
1161 """
1162 os = get_os();
1163 if os == 'linux' or os == 'solaris' or os == 'darwin':
1164 return 'lib' + name
1165 return name
1166
1167 def add_lib_suffix(name):
1168 """
1169 Adds the platform specific library suffix to a name
1161 """ 1170 """
1162 os = get_os(); 1171 os = get_os();
1163 if os == 'windows': 1172 if os == 'windows':
1164 return name + '.dll' 1173 return name + '.dll'
1165 if os == 'linux' or os == 'solaris': 1174 if os == 'linux' or os == 'solaris':