renamed babelcmd to nimblecmd; config files are now nim.cfg; other renamings
This commit is contained in:
parent
0f4567d59e
commit
cd2c6128d1
25 changed files with 187 additions and 43 deletions
|
|
@ -26,7 +26,7 @@ bootSwitch(usedNoGC, defined(nogc), "--gc:none")
|
|||
|
||||
import
|
||||
os, msgs, options, nversion, condsyms, strutils, extccomp, platform, lists,
|
||||
wordrecg, parseutils, babelcmd, idents
|
||||
wordrecg, parseutils, nimblecmd, idents
|
||||
|
||||
# but some have deps to imported modules. Yay.
|
||||
bootSwitch(usedTinyC, hasTinyCBackend, "-d:tinyc")
|
||||
|
|
@ -280,14 +280,15 @@ proc processSwitch(switch, arg: string, pass: TCmdLinePass, info: TLineInfo) =
|
|||
of "path", "p":
|
||||
expectArg(switch, arg, pass, info)
|
||||
addPath(processPath(arg), info)
|
||||
of "babelpath":
|
||||
if pass in {passCmd2, passPP} and not options.gNoBabelPath:
|
||||
of "nimblepath", "babelpath":
|
||||
# keep the old name for compat
|
||||
if pass in {passCmd2, passPP} and not options.gNoNimblePath:
|
||||
expectArg(switch, arg, pass, info)
|
||||
let path = processPath(arg, notRelativeToProj=true)
|
||||
babelPath(path, info)
|
||||
of "nobabelpath":
|
||||
nimblePath(path, info)
|
||||
of "nonimblepath", "nobabelpath":
|
||||
expectNoArg(switch, arg, pass, info)
|
||||
options.gNoBabelPath = true
|
||||
options.gNoNimblePath = true
|
||||
of "excludepath":
|
||||
expectArg(switch, arg, pass, info)
|
||||
let path = processPath(arg)
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ iterator chosen(packages: StringTableRef): string =
|
|||
let res = if val == latest: key else: key & '-' & val
|
||||
yield res
|
||||
|
||||
proc addBabelPath(p: string, info: TLineInfo) =
|
||||
proc addNimblePath(p: string, info: TLineInfo) =
|
||||
if not contains(options.searchPaths, p):
|
||||
if gVerbosity >= 1: message(info, hintPath, p)
|
||||
lists.prependStr(options.lazyPaths, p)
|
||||
|
|
@ -70,10 +70,10 @@ proc addPathWithNimFiles(p: string, info: TLineInfo) =
|
|||
result = true
|
||||
break
|
||||
if hasNimFile(p):
|
||||
addBabelPath(p, info)
|
||||
addNimblePath(p, info)
|
||||
else:
|
||||
for kind, p2 in walkDir(p):
|
||||
if hasNimFile(p2): addBabelPath(p2, info)
|
||||
if hasNimFile(p2): addNimblePath(p2, info)
|
||||
|
||||
proc addPathRec(dir: string, info: TLineInfo) =
|
||||
var packages = newStringTable(modeStyleInsensitive)
|
||||
|
|
@ -83,8 +83,8 @@ proc addPathRec(dir: string, info: TLineInfo) =
|
|||
if k == pcDir and p[pos] != '.':
|
||||
addPackage(packages, p)
|
||||
for p in packages.chosen:
|
||||
addBabelPath(p, info)
|
||||
addNimblePath(p, info)
|
||||
|
||||
proc babelPath*(path: string, info: TLineInfo) =
|
||||
proc nimblePath*(path: string, info: TLineInfo) =
|
||||
addPathRec(path, info)
|
||||
addBabelPath(path, info)
|
||||
addNimblePath(path, info)
|
||||
|
|
@ -224,8 +224,8 @@ proc loadConfigs*(cfg: string) =
|
|||
if libpath == "":
|
||||
# choose default libpath:
|
||||
var prefix = getPrefixDir()
|
||||
if prefix == "/usr": libpath = "/usr/lib/nimrod"
|
||||
elif prefix == "/usr/local": libpath = "/usr/local/lib/nimrod"
|
||||
if prefix == "/usr": libpath = "/usr/lib/nim"
|
||||
elif prefix == "/usr/local": libpath = "/usr/local/lib/nim"
|
||||
else: libpath = joinPath(prefix, "lib")
|
||||
|
||||
if optSkipConfigFile notin gGlobalOptions:
|
||||
|
|
@ -244,5 +244,6 @@ proc loadConfigs*(cfg: string) =
|
|||
|
||||
if gProjectName.len != 0:
|
||||
# new project wide config file:
|
||||
readConfigFile(changeFileExt(gProjectFull, "nimrod.cfg"))
|
||||
|
||||
let projectConfig = changeFileExt(gProjectFull, "nim.cfg")
|
||||
if fileExists(projectConfig): readConfigFile(projectConfig)
|
||||
else: readConfigFile(changeFileExt(gProjectFull, "nimrod.cfg"))
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ var
|
|||
gDirtyBufferIdx* = 0'i32 # indicates the fileIdx of the dirty version of
|
||||
# the tracked source X, saved by the CAAS client.
|
||||
gDirtyOriginalIdx* = 0'i32 # the original source file of the dirtified buffer.
|
||||
gNoBabelPath* = false
|
||||
gNoNimblePath* = false
|
||||
|
||||
proc importantComments*(): bool {.inline.} = gCmd in {cmdDoc, cmdIdeTools}
|
||||
proc usesNativeGC*(): bool {.inline.} = gSelectedGC >= gcRefc
|
||||
|
|
@ -139,7 +139,7 @@ const
|
|||
JsonExt* = "json"
|
||||
TexExt* = "tex"
|
||||
IniExt* = "ini"
|
||||
DefaultConfig* = "nimrod.cfg"
|
||||
DefaultConfig* = "nim.cfg"
|
||||
DocConfig* = "nimdoc.cfg"
|
||||
DocTexConfig* = "nimdoc.tex.cfg"
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue