mirror of
https://github.com/Sei-Lisa/LSL-PyOptimizer
synced 2025-07-01 23:58:20 +00:00
Add Clear to --optimizer-options, to unset all options.
This commit is contained in:
parent
b76063821b
commit
32840f4ad6
1 changed files with 12 additions and 3 deletions
15
main.py
15
main.py
|
@ -295,6 +295,9 @@ Case insensitive.
|
||||||
is useless with 'optimize' and 'optsigns', and is of
|
is useless with 'optimize' and 'optsigns', and is of
|
||||||
basically no use in general, other than to see where
|
basically no use in general, other than to see where
|
||||||
automatic casts happen.
|
automatic casts happen.
|
||||||
|
Clear - Set all options to inactive, Normally used as the first
|
||||||
|
option, to start afresh. Note that this sets to inactive
|
||||||
|
even the options that are active by default.
|
||||||
""")
|
""")
|
||||||
return
|
return
|
||||||
|
|
||||||
|
@ -345,14 +348,20 @@ def main(argv):
|
||||||
Usage(argv[0], 'optimizer-options')
|
Usage(argv[0], 'optimizer-options')
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
optchanges = arg.split(',')
|
optchanges = arg.lower().split(',')
|
||||||
for chg in optchanges:
|
for chg in optchanges:
|
||||||
|
if chg in ('clear', '+clear'):
|
||||||
|
options = set()
|
||||||
|
continue
|
||||||
|
if chg == '-clear':
|
||||||
|
# ignore
|
||||||
|
continue
|
||||||
if chg[0:1] not in ('+', '-'):
|
if chg[0:1] not in ('+', '-'):
|
||||||
chg = '+' + chg
|
chg = '+' + chg
|
||||||
if chg[0] == '-':
|
if chg[0] == '-':
|
||||||
options.discard(chg[1:].lower())
|
options.discard(chg[1:])
|
||||||
else:
|
else:
|
||||||
options.add(chg[1:].lower())
|
options.add(chg[1:])
|
||||||
|
|
||||||
elif opt in ('-h', '--help'):
|
elif opt in ('-h', '--help'):
|
||||||
Usage(argv[0])
|
Usage(argv[0])
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue