Re: Command Line Interface (CLI): your recommendations



Hello, Barry!
You wrote on Sun, 12 Feb 2006 11:08:48 -0800:

Thank you very much for useful tips.

[skip]
BS> But you are inconsistent. You actually copy the command but only
BS> store the argument addresses. What about the command is so special
BS> that you need to store the actual characters in cli->command rather
BS> than simply the address of the command in buf?


??>> while (1) {
??>> printf("%s", PROMPT);

BS> Use fflush here to force the output to your screen.

??>> if ( fgets(buf, BUFSIZ, stdin) ) {
??>> /* skip LF/CR/TAB/SP */
??>> if (buf[0] == '\n' || buf[0] == ' ' || buf[0] == '\r' ||
??>> buf[0] == '\t')

BS> Look up the isspace() function if you really want to do this. Are you
BS> sure you want to do this since the strtoken call in
BS> cliParseCommandLine() will very happily skip over leading white space
BS> for you?
Actually true, but my intention was to skip input consisting only of '\t',
'\n', ' ' and '\r'. That's isspace() is much better here.

With best regards, Roman Mashak. E-mail: mrv@xxxxxxxx


.



Relevant Pages

  • Re: 3.0.9 - shop UI changes are for the worse.
    ... I think the right approach is to consider items in the store to be analogous ... Any command you could give followed by a '-' to select from the floor should ... be usable in the shop in the same way, ...
    (rec.games.roguelike.angband)
  • Re: PKZip25 - How to include the current folder to the files ?
    ... I use -dir=full and list files, as in this example, but it should work ... PKZIP Command Line Translation Table ... store directory path names during compression, ...
    (comp.os.msdos.misc)
  • Re: link new field command button to contacts
    ... The ContactItem object has only one place to store such links -- in the Links collection. ... Author of Configuring Microsoft Outlook 2003 ... the same contact in all of the command button fields that I have set up. ... those automatically to my calender so it sets up a reminder? ...
    (microsoft.public.outlook.program_forms)
  • Re: automate photo import, link, and name
    ... Having read the threads you'll understand that it's best not to store ... You can get a list of them that you can import by opening a command ... and use an update query to extract the ID from the ... filename and put it into the new ID field. ...
    (microsoft.public.access.externaldata)
  • Re: ultra newbie question (dont laugh)
    ... you need to do is take data from the user (through a GUI, command line, ... etc.) and store them in some persistent state (text file, pickle, db, ...
    (comp.lang.python)