Changeset cdc6ff1 for commands.c


Ignore:
Timestamp:
Aug 22, 2008, 12:22:37 PM (16 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, debian, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
da466e0
Parents:
680ada9
Message:
Implement a getfilter command to get the text of a filter.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rb1fd36e rcdc6ff1  
    712712              "returns the value of a variable",
    713713              "getvar <varname>", ""),
     714
     715  OWLCMD_ARGS("getfilter", owl_command_getfilter, OWL_CTX_INTERACTIVE,
     716              "returns the definition of a filter",
     717              "getfilter <filtername>", ""),
    714718
    715719  OWLCMD_ARGS("getstyle", owl_command_getstyle, OWL_CTX_INTERACTIVE,
     
    24612465}
    24622466
     2467char *owl_command_getfilter(int argc, char **argv, char *buf)
     2468{
     2469  owl_filter *f;
     2470  if (argc != 2) {
     2471    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
     2472    return NULL;
     2473  }
     2474  f = owl_global_get_filter(&g, argv[1]);
     2475  if (!f) {
     2476    return NULL;
     2477  }
     2478  return owl_filter_print(f);
     2479}
     2480
    24632481char *owl_command_search(int argc, char **argv, char *buff)
    24642482{
Note: See TracChangeset for help on using the changeset viewer.