cdist/cdist/conf/type/__line
evilham c030deea3d [__line] Add support for '--state replace'
It is currently counter-intuitive that something like:

    # File '/thing' contents
    #SomeSetting WrongValue

    # Manifest
    __line '/thing' \
           --line 'SomeSeting GoodValue' \
           --regex '^(#[[:space:]]*)?SomeSetting[[:space:]]'

Produces:

    # Resulting '/thing' contents
    #SomeSetting WrongValue

This makes sense given the implementation, but it masks a very common use-case.

Changing the default behaviour for such a base type is not really an option, so
instead we add a `replace` as a valid value for `--state`, which would result
in:

    # Resulting '/thing' contents with: --state replace
    SomeSetting GoodValue

For compatibility, if the regex is missing, `--state replace` behaves just as
`--state present`.
2020-10-09 06:51:44 +02:00
..
explorer [__line] Add support for '--state replace' 2020-10-09 06:51:44 +02:00
parameter add --onchange to __line 2019-03-28 23:31:38 +02:00
gencode-remote [__line] Add support for '--state replace' 2020-10-09 06:51:44 +02:00
man.rst [__line] Add support for '--state replace' 2020-10-09 06:51:44 +02:00