public inbox for gnats-devel@sourceware.org
 help / color / mirror / Atom feed
From: Rick Macdonald <rickm@vsl.com>
To: Bob Manson <bmanson@juniper.net>
Cc: gnats-devel@sourceware.cygnus.com, bug-gnats@gnu.org
Subject: client info format ideas
Date: Mon, 23 Aug 1999 15:54:00 -0000	[thread overview]
Message-ID: <Pine.GSO.4.10.9908231517230.20253-100000@sys4> (raw)
In-Reply-To: <199908231912.MAA12266@tristam.juniper.net>

On Mon, 23 Aug 1999, Bob Manson wrote:

> I honestly don't have any idea what the configuration info as sent to
> clients will look like.  I think now would be a great time for people
> to make suggestions as to what they'd like to see.

OK, here's a rough suggestion, just to get some reactions. I've grabbed
these examples from your previous post:

        field "Release-Note" {
                multitext
                query-default exact-regexp
        }

        field "Release" {
                string matching "insert-regex-here"
                query-pr-option "A" "--release"
                network-query-command "RLSE"
                query-default inexact-regexp
        }

        field "Priority" {
                enum {
                        values {
                                "high" "medium" "low"
                        }
                        default "medium"
                }
                query-pr-option "p" "--priority"
                network-query-command "PRIO"
                query-default exact-regexp
        }

Looking now, wouldn't it be more straight-forward if all lines were
keyword-value pairs?

What's missing is that type-of-data has no keyword. It could be:

        field "Release-Note" {
                type multitext
and   
        field "Priority" {
		type enum
                enum { ...
  
and                      
                        
        field "Release" {
                type text
                stringmatching "insert-regex-here"

I'm not sure about your "string matching". Are there other sub options to
"string" other than "matching"? If not, that's why I combined it to one
keyword "stringmatching".

The point of this little cleanup suggestion is to facilitate this format:

fieldname "list of keyword-value pairs"

(I realize that the format of the gnats config files doesn't have to be
exactly like the info sent to clients, but it might as well start off
being more similar, I figure!)

Tcl and perl have different list syntax, but the following idea might be
useful for perl as well(?).

For Tcl:

fieldname {keyword {value} keyword {value} keyword {value}}

So, for the fields above:

Release-Note {type {multitext} query-default {exact-regexp}}

Release {type {text} stringmatching {[0-9]\.[0-9]} query-pr-option {A
--release} network-query-command {RLSE} query-default {inexact-regexp}}

Priority {type {enum} enum {values {high medium low} default {medium}}
query-pr-option {p --priority} network-query-command {PRIO} query-default
{exact-regexp}}

With this format, I don't even have to parse:

If variable "f" is set to the "Priority" line above:

% array set keys [lindex $f 1]
% array names keys
query-default network-query-command enum type query-pr-option

and now there's an array called "keys" with elements equal to your
keywords.

Note that "enum" is nested:

% puts $keys(enum)
values {high medium low} default {medium}

but I can do the same thing:

% array set enumkeys $keys(enum)
% array names enumkeys
values default
% puts $enumkeys(values)
high medium low

There may be drawbacks with the above, such as restricions on the number
of characters in one line (before an LF or CR/LF). Also, the brace
characters, if they exist in the keyword-values, would have to be escaped.

An alternative might be just a stream of records:

220 List follows.
field Priority
type enum
enumvalues high medium low
enumdefault medium
enumquery-pr-option p --priority
network-query-command PRIO 
query-default exact-regexp
field Release
...etc...
query-default inexact-regexp
.

In this case I've "flattened" the nested enum into the one level of
keyword-value pairs. It's not really much more work to read this and build
my own lists or arrays.

...RickM...


  reply	other threads:[~1999-08-23 15:54 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-18 11:21 proclamation of intent Bob Manson
1999-08-18 12:36 ` Rick Macdonald
1999-08-18 13:13   ` Bob Manson
1999-08-18 13:37     ` Stephen Dahmen
1999-08-18 14:15     ` Rick Macdonald
1999-08-23 10:21     ` Rick Macdonald
1999-08-23 10:27       ` Paul Traina
1999-08-23 10:28         ` Rick Macdonald
1999-08-24  5:23         ` Mike Sutton
1999-08-24  9:56           ` Michael Richardson
1999-08-23 10:38       ` Bob Manson
1999-08-23 10:48         ` Paul Traina
1999-08-23 10:52           ` Bob Manson
1999-08-23 10:54             ` Paul Traina
1999-08-23 11:13           ` Rick Macdonald
1999-08-23 11:32             ` Tony Parent
1999-08-23 11:41               ` Rick Macdonald
1999-08-23 12:12             ` Bob Manson
1999-08-23 15:54               ` Rick Macdonald [this message]
1999-08-24  5:35             ` Mike Sutton
1999-08-23 10:58         ` gnatsd accepting new PRs Rick Macdonald
1999-08-23 11:03           ` Bob Manson
1999-08-23 11:28             ` Tony Parent

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.GSO.4.10.9908231517230.20253-100000@sys4 \
    --to=rickm@vsl.com \
    --cc=bmanson@juniper.net \
    --cc=bug-gnats@gnu.org \
    --cc=gnats-devel@sourceware.cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).