This is a draft of how the new configuration might look. It's also out of sync with the on-going naming/type-safe revamp. Nothing here is definitive, let me know if you have any suggestions.
Up until now the configuration file syntax is vaguely defined, specially when it comes to variables resolution. A new syntax will be introduced with a clearer definition.
i.e. current syntax:
OPTION=value
will be a string assignment so
OPTION=some $value
will mean OPTION
value is literally some $value
In OPTION= value # comment
, OPTION
takes the value “value”, trimmed of spaces and without comment.
In OPTION=| value # comment|
, OPTION
takes the value “ value # comment”
Support unmatched? (OPTION=| value # comment
)
Inline comments will be explicitly allowed, #
can be included in values through the use of Literal assignments (=|
).
Maybe also through some escape sequence.
In OPTION=$value
, OPTION
takes the value “$value”, literally.
In OPTION=$value$
, OPTION
takes the value of the variable $value
.
Support unmatched? (OPTION=$value
)
Variables local to a configuration file will be allowed, so that:
bg_sign=DarkSlateGray bg_heading=DarkSlateGray bg_title=DarkSlateGray
Can be simplified as:
mycolor:=DarkSlateGray bg_sign=$mycolor$ bg_heading=$mycolor$ bg_title=$mycolor$
All other syntax changes use modified =
syntax with a postfix, might be more efficient to use them too (i.e. =:value
instead of :=value
)
(Upon consideration) OPTION⇒$value$
will take the same value the variable $value
has when OPTION is used (i.e. instead of the value it has when the configuration is parsed).
Currently per-user configuration is located in ~/.vcs.conf
, it will probably be moved to a dot-directory (candidates are ~/.vcs
, ~/.config/vcs
, or maybe ~/.local/share/vcs
).
Also /etc/vcs
for site-wide config.
The switch to directories won't be required until some of the features using extra files (like profiles and plugins) are implemented.
Specs for ~/.local/share
and ~/.config
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
Notes:
~/.config
appears to be an XDG standard and apparently should be limited to standard-specific uses 1)