Command-Line Item Macros

[posted 2004/06/23]

[Notes issued with the release of PIKT 1.17.0pre1, which introduced command-line item macros, giving A, O, P & F item specs the alias- and group- like functionality of H specs.]

Aside from the usual system monitoring and configuration management functions, the principal PIKT Maintainer uses PIKT to manage hundreds and hundreds of Web pages across several different Web sites (among them http://pikt.org and http://earlymusichicago.org).  With so many files to manage, it was getting harder and harder to specify with any precision the +F (or -F) specification in piktc command lines.  More often than not, files would be updated en masse using 'piktc -iv +F all ...' when what was really needed was a way to specify file subsets in an easy and convenient way.

PIKT 1.17.0pre1 introduces this capability.  You may now use item command-line item macros in your piktc commands, for example

# piktc -iv +F =apacheconf +H webserver

So, in your macros.cfg file (or some appropriate macro #include file), you might have

apacheconf      access.conf
                httpd.conf
                magic
                mailman.conf
                mime.types
                mod_php4.conf
                srm.conf
                [and so on...]

The above piktc command would be equivalent to

# piktc -iv +F access.conf httpd.conf magic mailman.conf mime.types
               mod_php4.conf srm.conf [...] +H webserver

In our macros.cfg files, we have defined Web page subsets, including for example

///////////////////////////////////////////////////////////////////////////////

piktdocs_devnotes
                devnotes-1.10.0.html
                devnotes-1.11.0.html
                [and so on...]

piktdocs_intro
                intro.html
                intro.1.html
                intro.2.html
                [and so on...]

[and so on...]

piktdocs
                authors.html
                faq.html
                index.html
                =piktdocs_devnotes
                =piktdocs_intro
                licensing.html
                links.html
                news.html
                =piktdocs_ref
                =piktdocs_samples
                software.html
                =piktdocs_tutorial

///////////////////////////////////////////////////////////////////////////////

To update just the intro pages, we might use

# piktc -iv +F =piktdocs_intro +H piktwebsys

To diff all PIKT-managed files except for the PIKT Web pages, we might use

# piktc -fv -F =piktdocs +H piktwebsys

To exclude also our named zone files, we might use

# piktc -fv -F =piktdocs =named_files +H piktwebsys

You may use similar command-line item macros in your piktc +/-A, +/-O, and +/-P specifications.  (Macros are not permitted in +/-H specifications, since you already have the needed functionality by means of host aliases and groups in systems.cfg.  Nor are macros allowed in +/-D or any other piktc item specifications.)

We hope you find this new feature to be as useful as we do.

For more examples, see Developer's Notes.

 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
HTML
font size
macros