Re: Suggested dual human/binary interface for proc/devfs

From: Mike Porter (mike@UDel.Edu)
Date: Mon Apr 10 2000 - 09:49:09 EST


On 9 Apr 2000, Russ Allbery wrote:

> George Bonser <grep@shorelink.com> writes:
> > On 9 Apr 2000, Russ Allbery wrote:
>
> >> This is a good point to consider, but I've also found that when
> >> non-programmers try to use those configuration files, they get confused
> >> by the semicolons and keeping the newline is more intuitive for them.
> >> But I don't have a lot of experience here, so I could be drawing
> >> incorrect conclusions.
>
> > It just means with the semicolons:
>
> > group0 {
> > item1=x;
> > item2=y;
> [...]
> > };
>
> > Is the same as:
>
> > group0{item1=x;item2=y;subgroup1{item1=a;item2=b};item3=c;};group1{item1=z;};
>
> > You can just ignore whitespace completely.
>
> I understand the theory, and it makes sense from the perspective of making
> it C-like, but like I said having to put the semicolons in there and
> realizing that they're not part of the value, escaping semicolons where
> necessary, and so forth I've found to be confusing to non-programmers who
> are trying to work with those configuration files. C programmers don't
> have a problem for the most part, but a lot of folks who aren't C
> programmers have to edit the config files.
>
> It doesn't matter as much for a /proc format, since there are very few
> writers and the average user only has to read.

I've used the idea of a 'command delimiter' before. This allows
the 'all on one line' style as shown above, along with the
multi-line format. But, when splitting long lines, a line
continuation character is needed.

group0 {
    item1=x;
    item2=y;
};
group0 { item1=x; item2=y; };

group0 {
    item1=y
    item2=y
}

group1 {
    item1="a really long string..." -
          "that continues to the next line.";
    item2=b
}

All three group0 mean the same. Multiple quoted strings seperated
by white space concatentate. Allowing arbitrary text to appear not
in quotes (item1=Intel Pentium III/500) is a bad idea in my opinion
since it raises to many escaping issues. Most people can learn
item1='Intel "extended" Pentium III...' or
item1="Intel ""extend... or item1="Intel \"extended...
There are lots of ways to handle quotes in quotes. Personally, I
would not support newline in quoted strings, it makes finding
missing quotes and reporting them accurately to users more
difficult.

So, we end up with all white space except newline ignored, but we
do have the line continuation character, which some people probably
find annoying. At least it doesn't have to be in column 72.

Mike

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sat Apr 15 2000 - 21:00:14 EST