mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-06-30 23:28:20 +00:00
Option to output error messages suitable for automated processing
Enables use of the optimizer as an editor plug-in.
This commit is contained in:
parent
f0068dd3bc
commit
68c8726a64
2 changed files with 27 additions and 6 deletions
12
main.py
12
main.py
|
@ -236,6 +236,8 @@ Usage: {progname}
|
|||
[--shortname=<name>] * specify the script's short file name
|
||||
[--prettify] Prettify source file. Disables all -O options.
|
||||
[--bom] Prefix script with a UTF-8 byte-order mark
|
||||
[--emap] Output error messages in a format suitable for
|
||||
automated processing
|
||||
filename input file
|
||||
|
||||
Options marked with * are used to define the preprocessor macros __AGENTID__,
|
||||
|
@ -403,7 +405,7 @@ def main(argv):
|
|||
try:
|
||||
opts, args = getopt.gnu_getopt(argv[1:], 'hO:o:p:P:HTyb:L:A:',
|
||||
('optimizer-options=', 'help', 'version', 'output=', 'header',
|
||||
'timestamp', 'python-exceptions', 'prettify', 'bom',
|
||||
'timestamp', 'python-exceptions', 'prettify', 'bom', 'emap',
|
||||
'preproc=', 'precmd=', 'prearg=', 'prenodef', 'preshow',
|
||||
'avid=', 'avname=', 'assetid=', 'shortname=', 'builtins='
|
||||
'libdata=', 'postarg='))
|
||||
|
@ -428,6 +430,7 @@ def main(argv):
|
|||
raise_exception = False
|
||||
prettify = False
|
||||
bom = False
|
||||
emap = False
|
||||
builtins = None
|
||||
libdata = None
|
||||
|
||||
|
@ -528,6 +531,10 @@ def main(argv):
|
|||
|
||||
elif opt == '--bom':
|
||||
bom = True
|
||||
|
||||
elif opt == '--emap':
|
||||
emap = True
|
||||
|
||||
del opts
|
||||
|
||||
if prettify:
|
||||
|
@ -686,6 +693,9 @@ def main(argv):
|
|||
|
||||
if not preshow:
|
||||
|
||||
if emap:
|
||||
options.add('emap')
|
||||
|
||||
lib = lslopt.lslloadlib.LoadLibrary(builtins, libdata)
|
||||
p = parser(lib)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue