[ofa-general] Re: [IBSIM] Parse sim cmds by name not first character
Al Chu
chu11 at llnl.gov
Mon Aug 18 17:39:50 PDT 2008
Hey Sasha,
New patch is attached.
Al
On Tue, 2008-08-19 at 02:01 +0300, Sasha Khapyorsky wrote:
> On 15:50 Mon 18 Aug , Al Chu wrote:
> >
> > The reason is that the ordering of the if statements now matters. If I
> > add a new command called "DoSomething", it must come after the "Dump"
> > comparison, otherwise the command "D" could take the "DoSomething"
> > branch.
>
> Sure, order will matter - new commands will be at end.
>
> Sasha
>
> > We can add a comments or something to document this. It's
> > obviously just a style difference.
> >
> > > >
> > > > But we would require
> > > > whitespace between the command and options for that to work.
> > >
> > > This is fine.
> > >
> > > What I meant is follow:
> > >
> > > unsigned cmd_len = 0;
> > >
> > > while (isalpha(line[cmd_len]))
> > > cmd_len++;
> > >
> > > if (!strncasecmp(line, "Dump", cmdlen))
> > > ...
> > >
> > > In this case strings "D", "du", etc. will be resolved as "Dump" command.
> >
> > Ok. I see what you were thinking now.
> >
> > Al
> >
> > > Sasha
> > --
> > Albert Chu
> > chu11 at llnl.gov
> > 925-422-5311
> > Computer Scientist
> > High Performance Systems Division
> > Lawrence Livermore National Laboratory
> >
--
Albert Chu
chu11 at llnl.gov
925-422-5311
Computer Scientist
High Performance Systems Division
Lawrence Livermore National Laboratory
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-parse-sim-cmds-via-full-name.patch
Type: text/x-patch
Size: 3543 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20080818/59297bb5/attachment.bin>
More information about the general
mailing list