make config.nims behave like nim.cfg in terms of where these scripts are searched / run (#8682)

* run project config.nims if exists, then inputfile.nims if exists
* ~/.config/nim/config.nims can now be used
* also check in getSystemConfigPath for config.nims
* refactor handleCmdLine for nim and nimsuggest
This commit is contained in:
Timothee Cour 2018-08-30 04:52:32 -07:00 • committed by Andreas Rumpf
commit ed0cb7b85d
7 changed files with 152 additions and 114 deletions

View file

@ -54,10 +54,10 @@ type # please make sure we have under 32 options
optGenMapping, # generate a mapping file
optRun, # run the compiled project
optCheckNep1, # check that the names adhere to NEP-1
optSkipConfigFile, # skip the general config file
optSkipProjConfigFile, # skip the project's config file
optSkipUserConfigFile, # skip the users's config file
optSkipParentConfigFiles, # skip parent dir's config files
optSkipSystemConfigFile, # skip the system's cfg/nims config file
optSkipProjConfigFile, # skip the project's cfg/nims config file
optSkipUserConfigFile, # skip the users's cfg/nims config file
optSkipParentConfigFiles, # skip parent dir's cfg/nims config files
optNoMain, # do not generate a "main" proc
optUseColors, # use colors for hints, warnings, and errors
optThreads, # support for multi-threading
@ -391,6 +391,7 @@ const
TexExt* = "tex"
IniExt* = "ini"
DefaultConfig* = "nim.cfg"
DefaultConfigNims* = "config.nims"
DocConfig* = "nimdoc.cfg"
DocTexConfig* = "nimdoc.tex.cfg"