Hmm, sorry, I disagree. The XML looks even worse for a human to edit, sure, its readable, but to create by hand? Yuck.

OTOH you did give me another idea: The one with leaving out the ftp_instances variable, and just getting the user to give information for each ftp instance. I can create the value of ftp_instances dynamically, the IDs too, since they just need to be unique.

Another way to do it would be to have variables with a list of values for each ftp_instance variable, but I think that's uglier:

hostnames=one,two,three sourcepaths=/path/one,/path/two,/path/three
(and less usable)

As for your other concerns, the variables can't contain newlines, the split only splits on the first '=' and variable names cant contain an '=' or a space. (These are unix environment vars, so I'd be quite surprised if that even worked, the config files contain mostly a bunch of "export VAR=X", anyway, even if it was possible, this software doesn't have any).

These won't be idiots, that will be running this, after all, they usually install the software by editing all of it's config files, and getting them lined up with each other. I'm just trying to make the process easier, without making it more complex in the process.

Duplicating data is not a bad thing, if it provides more clarity.. IMO

C.


In reply to Re^2: Configuration file design by castaway
in thread Configuration file design by castaway

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.