Ignore:
Timestamp:
Mar 30, 2008, 6:13:55 AM (17 years ago)
Author:
bird
Message:

Added comp-cmds-ex, commands, commands-sc and commands-usr. Added a '%' command prefix that make the commands functions skip the line. Added a -c flag to append that'll make it call commands on each argument (similar to -v). Fixed a little bug in comp-cmds/vars.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/commands.c

    r903 r1440  
    332332
    333333  cmds->any_recurse = 0;
     334#ifdef CONFIG_WITH_COMMANDS_FUNC
     335  cmds->lines_flags = xmalloc (nlines * sizeof (cmds->lines_flags[0]));
     336#else
    334337  cmds->lines_flags = xmalloc (nlines);
     338#endif
    335339  for (idx = 0; idx < nlines; ++idx)
    336340    {
     
    338342
    339343      for (p = lines[idx];
     344#ifdef CONFIG_WITH_COMMANDS_FUNC
     345           isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+' || *p == '%';
     346#else
    340347           isblank ((unsigned char)*p) || *p == '-' || *p == '@' || *p == '+';
     348#endif
    341349           ++p)
    342350        switch (*p)
     
    351359            flags |= COMMANDS_NOERROR;
    352360            break;
     361#ifdef CONFIG_WITH_COMMANDS_FUNC
     362          case '%':
     363            flags |= COMMAND_GETTER_SKIP_IT;
     364            break;
     365#endif
    353366          }
    354367
Note: See TracChangeset for help on using the changeset viewer.