NAME

App::Cme::Command::modify - Modify the configuration of an application

VERSION

version 1.042

SYNOPSIS

# modify configuration with command line
cme modify dpkg source 'format="(3.0) quilt"'

DESCRIPTION

Modify a configuration file with the values passed on the command line. These command must follow the syntax defined in Config::Model::Loader (which is similar to the output of cme dump command)

Example:

cme modify dpkg 'source format="(3.0) quilt"'
cme modify multistrap my_mstrap.conf 'sections:base source="http://ftp.fr.debian.org"'

Finding the right instructions to perform a modification may be difficult when starting from scratch.

To get started, you can run cme dump --format cml command to get the content of your configuration in the syntax accepted by cme modify:

$ cme dump ssh -format cml
Host:"*" -
Host:"alioth.debian.org"
  User=dod -
Host:"*.debian.org"
  IdentityFile:="~/.ssh/id_debian"
  User=dod -

Then you can use this output to create instruction for a modification:

$  cme modify ssh 'Host:"*" User=dod'
Changes applied to ssh configuration:
- Host:"*" User has new value: 'dod'

Common options

See "Global Options" in cme.

options

-save

Force a save even if no change was done. Useful to reformat the configuration file.

-verbose

Show effect of the modify instructions.

Examples

Set identity file for a domain

$ cme modify ssh 'Host:"*.work.com" IdentityFile:="~/.ssh/id_work"'

This example requires Config::Model::OpenSsh.

Update Dpkg file

To set Architecture parameter for all binary packages:

$ cme modify dpkg-control 'binary:~".*" Architecture=any'

This achieves the same result but can be slower since all package files are read:

$ cme modify dpkg 'control binary:~".*" Architecture=any'

This Debian example requires libconfig-model-dpkg-perl

Re-use your one-liners

These modification instructions can be re-used once they are stored in a run script (See App::Cme::Command::run for details).

The following one-liner:

$ cme modify dpkg 'control binary:~".*" Architecture=any'

can be stored in ~/.cme/scripts/set-arch-as-any:

app: dpkg-control
load: binary:~".*" Architecture=any

and then run with:

$ cme run set-arch-as-any

SEE ALSO

cme

AUTHOR

Dominique Dumont

COPYRIGHT AND LICENSE

This software is Copyright (c) 2014-2022 by Dominique Dumont <ddumont@cpan.org>.

This is free software, licensed under:

The GNU Lesser General Public License, Version 2.1, February 1999