mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 11:25:08 +00:00
Adds -l:line# command line switch to start the ide at a certain line.
This commit is contained in:
parent
88d6911ec9
commit
c096896105
3 changed files with 29 additions and 30 deletions
|
@ -167,6 +167,8 @@ DIM SHARED EnteringRGB AS _BYTE
|
||||||
DIM SHARED ActiveINCLUDELink AS LONG
|
DIM SHARED ActiveINCLUDELink AS LONG
|
||||||
DIM SHARED ActiveINCLUDELinkFile AS STRING
|
DIM SHARED ActiveINCLUDELinkFile AS STRING
|
||||||
DIM SHARED HideCurrentLineHighlight AS _BYTE, ShowLineNumbers AS _BYTE
|
DIM SHARED HideCurrentLineHighlight AS _BYTE, ShowLineNumbers AS _BYTE
|
||||||
|
DIM SHARED idegotobox_LastLineNum AS LONG
|
||||||
|
|
||||||
'--------------------------------------------------------------------------------
|
'--------------------------------------------------------------------------------
|
||||||
TYPE idedbptype
|
TYPE idedbptype
|
||||||
x AS LONG
|
x AS LONG
|
||||||
|
|
|
@ -507,6 +507,12 @@ FUNCTION ide2 (ignore)
|
||||||
LOOP UNTIL asca = 13
|
LOOP UNTIL asca = 13
|
||||||
lineinput3buffer = ""
|
lineinput3buffer = ""
|
||||||
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
iden = n: IF n = 0 THEN idet$ = MKL$(0) + MKL$(0): iden = 1 ELSE idet$ = LEFT$(idet$, i2 - 1)
|
||||||
|
IF ideStartAtLine > 0 AND ideStartAtLine <= iden THEN
|
||||||
|
idecy = ideStartAtLine
|
||||||
|
IF idecy - 10 >= 1 THEN idesy = idecy - 10
|
||||||
|
idegotobox_LastLineNum = ideStartAtLine
|
||||||
|
ideStartAtLine = 0
|
||||||
|
END IF
|
||||||
IdeBmkN = 0
|
IdeBmkN = 0
|
||||||
ideerror = 1
|
ideerror = 1
|
||||||
ideprogname = f$: _TITLE ideprogname + " - QB64"
|
ideprogname = f$: _TITLE ideprogname + " - QB64"
|
||||||
|
@ -10559,8 +10565,6 @@ FUNCTION idemodifycommandbox
|
||||||
END FUNCTION
|
END FUNCTION
|
||||||
|
|
||||||
FUNCTION idegotobox
|
FUNCTION idegotobox
|
||||||
STATIC idegotobox_LastLineNum AS LONG
|
|
||||||
|
|
||||||
'-------- generic dialog box header --------
|
'-------- generic dialog box header --------
|
||||||
PCOPY 0, 2
|
PCOPY 0, 2
|
||||||
PCOPY 0, 1
|
PCOPY 0, 1
|
||||||
|
|
|
@ -338,6 +338,7 @@ DIM SHARED idemessage AS STRING 'set by qb64-error(...) to the error message to
|
||||||
|
|
||||||
DIM SHARED optionexplicit AS _BYTE
|
DIM SHARED optionexplicit AS _BYTE
|
||||||
DIM SHARED optionexplicit_cmd AS _BYTE
|
DIM SHARED optionexplicit_cmd AS _BYTE
|
||||||
|
DIM SHARED ideStartAtLine AS LONG
|
||||||
DIM SHARED outputfile_cmd$
|
DIM SHARED outputfile_cmd$
|
||||||
DIM SHARED compilelog$
|
DIM SHARED compilelog$
|
||||||
|
|
||||||
|
@ -12663,16 +12664,12 @@ FUNCTION ParseCMDLineArgs$ ()
|
||||||
'in which case they're simply asking for trouble).
|
'in which case they're simply asking for trouble).
|
||||||
FOR i = 1 TO _COMMANDCOUNT
|
FOR i = 1 TO _COMMANDCOUNT
|
||||||
token$ = COMMAND$(i)
|
token$ = COMMAND$(i)
|
||||||
|
IF LCASE$(token$) = "-help" OR LCASE$(token$) = "/help" THEN token$ = "-?"
|
||||||
SELECT CASE LCASE$(LEFT$(token$, 2))
|
SELECT CASE LCASE$(LEFT$(token$, 2))
|
||||||
CASE "/?", "-?", "-h" 'Command-line help
|
CASE "-?", "/?" 'Command-line help
|
||||||
_DEST _CONSOLE
|
_DEST _CONSOLE
|
||||||
PRINT "QB64 COMPILER V" + Version$
|
PRINT "QB64 COMPILER V" + Version$
|
||||||
PRINT
|
PRINT
|
||||||
IF LCASE$(token$) <> "-help" AND LCASE$(token$) <> "-h" AND token$ <> "-?" AND token$ <> "/?" THEN
|
|
||||||
'Ended up being a filename?
|
|
||||||
PassedFileName$ = token$
|
|
||||||
GOTO NextCase
|
|
||||||
END IF
|
|
||||||
PRINT "USAGE: qb64 [switches] <inputs>"
|
PRINT "USAGE: qb64 [switches] <inputs>"
|
||||||
PRINT
|
PRINT
|
||||||
PRINT "OPTIONS:"
|
PRINT "OPTIONS:"
|
||||||
|
@ -12681,42 +12678,41 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
PRINT " -x Compile instead of edit and output the result to the"
|
PRINT " -x Compile instead of edit and output the result to the"
|
||||||
PRINT " console"
|
PRINT " console"
|
||||||
PRINT " -z Generate C code without compiling to executable"
|
PRINT " -z Generate C code without compiling to executable"
|
||||||
'PRINT " -g Non-GUI environment (uses $CONSOLE:ONLY - for G-WAN"
|
|
||||||
'PRINT " compilation)"
|
|
||||||
PRINT " -o <file> Write output executable to <file>"
|
PRINT " -o <file> Write output executable to <file>"
|
||||||
PRINT " -e Enables OPTION _EXPLICIT, making variable declaration"
|
PRINT " -e Enables OPTION _EXPLICIT, making variable declaration"
|
||||||
PRINT " mandatory (per-compilation; doesn't affect the"
|
PRINT " mandatory (per-compilation; doesn't affect the"
|
||||||
PRINT " source file or global settings)"
|
PRINT " source file or global settings)"
|
||||||
PRINT " -s[:switch=true/false] View/edit compiler settings"
|
PRINT " -s[:switch=true/false] View/edit compiler settings"
|
||||||
|
PRINT " -l:<line number> Starts the IDE at the specified line number"
|
||||||
PRINT
|
PRINT
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s" 'Settings
|
CASE "-s", "/s" 'Settings
|
||||||
_DEST _CONSOLE
|
_DEST _CONSOLE
|
||||||
PRINT "QB64 COMPILER V" + Version$
|
PRINT "QB64 COMPILER V" + Version$
|
||||||
SELECT CASE LCASE$(token$)
|
SELECT CASE LCASE$(MID$(token$, 3))
|
||||||
CASE "-s"
|
CASE ""
|
||||||
PRINT "debuginfo = ";
|
PRINT "debuginfo = ";
|
||||||
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
PRINT "exewithsource = ";
|
PRINT "exewithsource = ";
|
||||||
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource"
|
CASE ":exewithsource"
|
||||||
PRINT "exewithsource = ";
|
PRINT "exewithsource = ";
|
||||||
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF SaveExeWithSource THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource=true"
|
CASE ":exewithsource=true"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "TRUE"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "TRUE"
|
||||||
PRINT "exewithsource = TRUE"
|
PRINT "exewithsource = TRUE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:exewithsource=false"
|
CASE ":exewithsource=false"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "FALSE"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "SaveExeWithSource", "FALSE"
|
||||||
PRINT "exewithsource = FALSE"
|
PRINT "exewithsource = FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo"
|
CASE ":debuginfo"
|
||||||
PRINT "debuginfo = ";
|
PRINT "debuginfo = ";
|
||||||
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
IF idedebuginfo THEN PRINT "TRUE" ELSE PRINT "FALSE"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo=true"
|
CASE ":debuginfo=true"
|
||||||
PRINT "debuginfo = TRUE"
|
PRINT "debuginfo = TRUE"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "TRUE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "TRUE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||||
idedebuginfo = 1
|
idedebuginfo = 1
|
||||||
|
@ -12737,7 +12733,7 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
CHDIR "../.."
|
CHDIR "../.."
|
||||||
END IF
|
END IF
|
||||||
SYSTEM
|
SYSTEM
|
||||||
CASE "-s:debuginfo=false"
|
CASE ":debuginfo=false"
|
||||||
PRINT "debuginfo = FALSE"
|
PRINT "debuginfo = FALSE"
|
||||||
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
WriteConfigSetting "'[GENERAL SETTINGS]", "DebugInfo", "FALSE 'INTERNAL VARIABLE USE ONLY!! DO NOT MANUALLY CHANGE!"
|
||||||
idedebuginfo = 0
|
idedebuginfo = 0
|
||||||
|
@ -12766,27 +12762,24 @@ FOR i = 1 TO _COMMANDCOUNT
|
||||||
PRINT " -s:exewithsource=true/false (Save .EXE in the source folder)"
|
PRINT " -s:exewithsource=true/false (Save .EXE in the source folder)"
|
||||||
SYSTEM
|
SYSTEM
|
||||||
END SELECT
|
END SELECT
|
||||||
CASE "-q" 'Building a Qloud program
|
CASE "-e", "/e" 'Option Explicit
|
||||||
Cloud = 1
|
|
||||||
ConsoleMode = 1 'Implies -x
|
|
||||||
NoIDEMode = 1 'Imples -c
|
|
||||||
CASE "-e" 'Option Explicit
|
|
||||||
optionexplicit_cmd = -1
|
optionexplicit_cmd = -1
|
||||||
CASE "-z" 'Not compiling C code
|
CASE "-z", "/z" 'Not compiling C code
|
||||||
No_C_Compile_Mode = 1
|
No_C_Compile_Mode = 1
|
||||||
ConsoleMode = 1 'Implies -x
|
ConsoleMode = 1 'Implies -x
|
||||||
NoIDEMode = 1 'Implies -c
|
NoIDEMode = 1 'Implies -c
|
||||||
CASE "-x" 'Use the console
|
CASE "-x", "/x" 'Use the console
|
||||||
ConsoleMode = 1
|
ConsoleMode = 1
|
||||||
NoIDEMode = 1 'Implies -c
|
NoIDEMode = 1 'Implies -c
|
||||||
CASE "-c" 'Compile instead of edit
|
CASE "-c", "/c" 'Compile instead of edit
|
||||||
NoIDEMode = 1
|
NoIDEMode = 1
|
||||||
CASE "-o" 'Specify an output file
|
CASE "-o", "/o" 'Specify an output file
|
||||||
IF LEN(COMMAND$(i + 1)) > 0 THEN outputfile_cmd$ = COMMAND$(i + 1): i = i + 1
|
IF LEN(COMMAND$(i + 1)) > 0 THEN outputfile_cmd$ = COMMAND$(i + 1): i = i + 1
|
||||||
|
CASE "-l", "/l" 'goto line (ide mode only); -l:<line number>
|
||||||
|
IF MID$(token$, 3, 1) = ":" THEN ideStartAtLine = VAL(MID$(token$, 4))
|
||||||
CASE ELSE 'Something we don't recognise, assume it's a filename
|
CASE ELSE 'Something we don't recognise, assume it's a filename
|
||||||
PassedFileName$ = token$
|
IF PassedFileName$ = "" THEN PassedFileName$ = token$
|
||||||
END SELECT
|
END SELECT
|
||||||
NextCase:
|
|
||||||
NEXT i
|
NEXT i
|
||||||
|
|
||||||
IF LEN(PassedFileName$) THEN ParseCMDLineArgs$ = PassedFileName$
|
IF LEN(PassedFileName$) THEN ParseCMDLineArgs$ = PassedFileName$
|
||||||
|
|
Loading…
Reference in a new issue