From 2cfa8d838590d8e6a2df42591f6887a9817be74d Mon Sep 17 00:00:00 2001 From: BinHong Lee Date: Sun, 5 Jan 2020 10:24:30 -0800 Subject: [PATCH] Allow `-o` option for `buildIndex` (#13037) [backport] Addressing #12771 This is also included in the docgen documentation [here](https://nim-lang.org/docs/docgen.html) but its not respected as reported in the issue. --- compiler/docgen.nim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/compiler/docgen.nim b/compiler/docgen.nim index f75c16d02aeec..5eaaed12041df 100644 --- a/compiler/docgen.nim +++ b/compiler/docgen.nim @@ -1168,6 +1168,9 @@ proc commandBuildIndex*(cache: IdentCache, conf: ConfigRef) = ["Index".rope, nil, nil, rope(getDateStr()), rope(getClockStr()), content, nil, nil, nil]) # no analytics because context is not available - let filename = getOutFile(conf, RelativeFile"theindex", HtmlExt) + var outFile = RelativeFile"theindex" + if conf.outFile != RelativeFile"": + outFile = conf.outFile + let filename = getOutFile(conf, outFile, HtmlExt) if not writeRope(code, filename): rawMessage(conf, errCannotOpenFile, filename.string)