nim-lang / Nim

Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
https://nim-lang.org
Other
16.55k stars 1.47k forks source link

[cmdline] [minor] `--hint.foo:on` as alias for `--hint[foo]:on`: avoids edge cases with `[` that needs to be escaped on cmd line + other places #8739

Closed timotheecour closed 6 years ago

timotheecour commented 6 years ago

--hint[foo], although having a cute syntax, is a non-standard convention that causes inconveniences and un-necessary edge cases:

config.nims:

# Error: invalid command line option: '--hint[source]'
--hint[source]:on

# Error: missing closing ' for character literal
'--hint[source]:on'

# Error: invalid command line option: '--hint[source]'
switch("hint[source]", "on")

# ok, that works, but I had to search quite a bit before I found it; makes it more awkward to go from nim.cfg to config.nims
hint("processing", on)

proposal:

Araq commented 6 years ago

Ok, accepted.