nim doc -r main and nim rst2html -r main now call openDefaultBrowser (#14285)
This commit is contained in:
parent
8e93105606
commit
dda6f3f6d4
2 changed files with 16 additions and 4 deletions
|
|
@ -140,6 +140,7 @@
|
||||||
- `--hint:processing` is now supported and means `--hint:processing:on`
|
- `--hint:processing` is now supported and means `--hint:processing:on`
|
||||||
(likewise with other hints and warnings), which is consistent with all other bool flags.
|
(likewise with other hints and warnings), which is consistent with all other bool flags.
|
||||||
(since 1.3.3).
|
(since 1.3.3).
|
||||||
|
- `nim doc -r main` and `nim rst2html -r main` now call openDefaultBrowser
|
||||||
|
|
||||||
## Tool changes
|
## Tool changes
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,8 @@ import
|
||||||
idents, lineinfos, cmdlinehelper,
|
idents, lineinfos, cmdlinehelper,
|
||||||
pathutils
|
pathutils
|
||||||
|
|
||||||
include nodejs
|
from browsers import openDefaultBrowser
|
||||||
|
from nodejs import findNodeJs
|
||||||
|
|
||||||
when hasTinyCBackend:
|
when hasTinyCBackend:
|
||||||
import tccgen
|
import tccgen
|
||||||
|
|
@ -86,11 +87,21 @@ proc handleCmdLine(cache: IdentCache; conf: ConfigRef) =
|
||||||
if conf.cmd == cmdRun:
|
if conf.cmd == cmdRun:
|
||||||
tccgen.run(conf, conf.arguments)
|
tccgen.run(conf, conf.arguments)
|
||||||
if optRun in conf.globalOptions:
|
if optRun in conf.globalOptions:
|
||||||
var ex = quoteShell conf.absOutFile
|
let output = conf.absOutFile
|
||||||
if conf.cmd == cmdCompileToJS:
|
let ex = quoteShell output
|
||||||
|
case conf.cmd
|
||||||
|
of cmdCompileToJS:
|
||||||
execExternalProgram(conf, findNodeJs() & " " & ex & ' ' & conf.arguments)
|
execExternalProgram(conf, findNodeJs() & " " & ex & ' ' & conf.arguments)
|
||||||
else:
|
of cmdDoc, cmdRst2html:
|
||||||
|
if conf.arguments.len > 0:
|
||||||
|
# reserved for future use
|
||||||
|
rawMessage(conf, errGenerated, "'$1 cannot handle arguments" % [$conf.cmd])
|
||||||
|
openDefaultBrowser($output)
|
||||||
|
of cmdCompileToC, cmdCompileToCpp, cmdCompileToOC:
|
||||||
execExternalProgram(conf, ex & ' ' & conf.arguments)
|
execExternalProgram(conf, ex & ' ' & conf.arguments)
|
||||||
|
else:
|
||||||
|
# support as needed
|
||||||
|
rawMessage(conf, errGenerated, "'$1 cannot handle --run" % [$conf.cmd])
|
||||||
|
|
||||||
when declared(GC_setMaxPause):
|
when declared(GC_setMaxPause):
|
||||||
GC_setMaxPause 2_000
|
GC_setMaxPause 2_000
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue