.\" Automatically generated by Pod::Man 4.07 (Pod::Simple 3.32) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "App::Cme::Command::run 3pm" .TH App::Cme::Command::run 3pm "2017-06-05" "perl v5.24.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" App::Cme::Command::run \- Run a cme script .SH "VERSION" .IX Header "VERSION" version 1.020 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 8 \& $ cat ~/.cme/scripts/remove\-mia \& doc: remove mia from Uploders. Require mia parameter \& # declare app to configure \& app: dpkg \& # specify one or more instructions \& load: ! control source Uploaders:\-~/$mia$/ \& # commit the modifications with a message (git only) \& commit: remove MIA dev $mia \& \& $ cme run remove\-mia \-arg mia=longgone@d3bian.org \& \& # cme run can also use environment variables \& $ cat ~/.cme/scripts/add\-me\-to\-uploaders \& app: dpkg\-control \& load: source Uploaders:.push("$DEBFULLNAME <$DEBEMAIL>") \& \& $ cme run add\-me\-to\-uploaders \& Reading package lists... Done \& Building dependency tree \& Reading state information... Done \& Changes applied to dpkg\-control configuration: \& \- source Uploaders:3: \*(Aq\*(Aq \-> \*(AqDominique Dumont \*(Aq \& \& # show the script documentation \& $ cme run remove\-mia \-doc \& remove mia from Uploders. require mia parameter \& \& # list scripts \& $ cme run \-list \& Available scripts: \& \- update\-copyright \& \- add\-me\-to\-uploaders .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" Run a script written with cme \s-1DSL \s0(Design specific language) or in plain Perl. .PP A script passed by name is searched in \f(CW\*(C`~/.cme/scripts\*(C'\fR, \&\f(CW\*(C`/etc/cme/scripts\*(C'\fR or \f(CW\*(C`/usr/share/perl5/Config/Model/scripts\*(C'\fR. E.g. with \f(CW\*(C`cme run foo\*(C'\fR, \f(CW\*(C`cme\*(C'\fR loads either \f(CW\*(C`~/.cme/scripts/foo\*(C'\fR, \&\f(CW\*(C`/etc/cme/scripts/foo\*(C'\fR or \&\f(CW\*(C`/usr/share/perl5/Config/Model/scripts/foo\*(C'\fR .PP No search is done if the script is passed with a path (e.g. \f(CW\*(C`cme run ./foo\*(C'\fR) .PP \&\f(CW\*(C`cme run\*(C'\fR can also run plain Perl script. This is syntactic sugar to avoid polluting global namespace, i.e. there's no need to store a script using cme function in \f(CW\*(C`/usr/local/bin/\*(C'\fR. .PP When run, this script: .IP "\(bu" 4 opens the configuration file of \f(CW\*(C`app\*(C'\fR .IP "\(bu" 4 applies the modifications specified with \f(CW\*(C`load\*(C'\fR instructions .IP "\(bu" 4 save the configuration files .IP "\(bu" 4 commits the result if \f(CW\*(C`commit\*(C'\fR is specified. .PP See App::Cme::Command::run for details. .SH "Syntax" .IX Header "Syntax" The script accepts instructions in the form: .PP .Vb 1 \& key: value .Ve .PP The script accepts the following instructions: .IP "app" 4 .IX Item "app" Specify the target application. Must be one of the application listed by \f(CW\*(C`cme list\*(C'\fR command. Mandatory. Only one \f(CW\*(C`app\*(C'\fR instruction is allowed. .IP "var" 4 .IX Item "var" Use Perl code to specify variables usable in this script. The Perl code must store data in \f(CW%var\fR hash. For instance: .Sp .Vb 1 \& perl: my @l = localtime; $var{year} = $l[5]+1900; .Ve .Sp The hash \f(CW%args\fR contains the variables passed with the \f(CW\*(C`\-arg\*(C'\fR option. Reading a value from \f(CW%args\fR which is set by the user triggers an error. .IP "load" 4 .IX Item "load" Specify the modifications to apply using a string as specified in Config::Model::Loader .IP "commit" 4 .IX Item "commit" Specify that the change must be committed with the passed commit message. When this option is used, \f(CW\*(C`cme\*(C'\fR raises an error if used on a non-clean workspace. This option works only with git. .PP All instructions can use variables like \f(CW$stuff\fR whose value can be specified with \f(CW\*(C`\-arg\*(C'\fR options, with a Perl variable (from \f(CW\*(C`var:\*(C'\fR section explained above) or with an environment variable: .PP For instance: .PP .Vb 1 \& cme run \-arg var1=foo \-arg var2=bar .Ve .PP transforms the instruction: .PP .Vb 1 \& load: ! a=$var1 b=$var2 .Ve .PP in .PP .Vb 1 \& load: ! a=foo b=bar .Ve .SH "Options" .IX Header "Options" .SS "list" .IX Subsection "list" List available scripts and exits. .SS "arg" .IX Subsection "arg" Arguments for the cme scripts which are used to substitute variables. .SS "doc" .IX Subsection "doc" Show the script documentation. (Note that \f(CW\*(C`\-\-help\*(C'\fR options show the documentation of \f(CW\*(C`cme run\*(C'\fR command) .SH "Common options" .IX Header "Common options" See \*(L"Global Options\*(R" in cme. .SH "Examples" .IX Header "Examples" .ie n .SS "update copyright years in ""debian/copyright""" .el .SS "update copyright years in \f(CWdebian/copyright\fP" .IX Subsection "update copyright years in debian/copyright" .Vb 10 \& $ cat ~/.cme/scripts/update\-copyright \& app: dpkg\-copyright \& load: Files:~ Copyright=~"s/2016,?\es+$name/2017, $name/g" \& commit: updated copyright year of $name \& $ cme run update\-copyright \-arg "name=Dominique Dumont" \& cme: using Dpkg::Copyright model \& Changes applied to dpkg\-copyright configuration: \& \- Files:"*" Copyright: \*(Aq2005\-2016, Dominique Dumont \*(Aq \-> \*(Aq2005\-2017, Dominique Dumont \*(Aq \& \- Files:"lib/Dpkg/Copyright/Scanner.pm" Copyright: \& @@ \-1,2 +1,2 @@ \& \-2014\-2016, Dominique Dumont \& +2014\-2017, Dominique Dumont \& 2005\-2012, Jonas Smedegaard \& \& [master ac2e6410] updated copyright year of Dominique Dumont \& 1 file changed, 2 insertions(+), 2 deletions(\-) .Ve .SH "SEE ALSO" .IX Header "SEE ALSO" cme .SH "AUTHOR" .IX Header "AUTHOR" Dominique Dumont .SH "COPYRIGHT AND LICENSE" .IX Header "COPYRIGHT AND LICENSE" This software is Copyright (c) 2017 by Dominique Dumont. .PP This is free software, licensed under: .PP .Vb 1 \& The GNU Lesser General Public License, Version 2.1, February 1999 .Ve