Changeset 7869e48 for commands.c


Ignore:
Timestamp:
Jan 12, 2013, 1:43:13 PM (11 years ago)
Author:
Jason Gross <jgross@mit.edu>
Children:
e3a0d71, 4485285
Parents:
4626016
git-author:
Jason Gross <jgross@mit.edu> (01/12/13 13:13:18)
git-committer:
Jason Gross <jgross@mit.edu> (01/12/13 13:43:13)
Message:
Remove trailing whitespace

This commit was made with the command sequence

    for i in $(git ls-files | tr '\n' ' ');
    do
      echo $i; sed -i s'/\s\+$//g' "$(readlink -f $i)";
    done
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r39a531d r7869e48  
    6969              "",
    7070              ""),
    71  
     71
    7272  OWLCMD_ARGS("start-command", owl_command_start_command, OWL_CTX_INTERACTIVE,
    7373              "prompts the user to enter a command",
     
    125125              "send an AIM message",
    126126              "aimwrite <user> [-m <message...>]",
    127               "Send an aim message to a user.\n\n" 
     127              "Send an aim message to a user.\n\n"
    128128              "The following options are available:\n\n"
    129129              "-m    Specifies a message to send without prompting.\n"),
     
    139139              "Behaves like zwrite but uses encryption.  Not for use with\n"
    140140              "personal messages\n"),
    141  
     141
    142142  OWLCMD_ARGS("reply", owl_command_reply,  OWL_CTX_INTERACTIVE,
    143143              "reply to the current message",
     
    217217  OWLCMD_VOID("unsuball", owl_command_unsuball, OWL_CTX_ANY,
    218218              "unsubscribe from all zephyrs", "", ""),
    219  
     219
    220220  OWLCMD_VOID("getsubs", owl_command_getsubs, OWL_CTX_ANY,
    221221              "print all current subscriptions",
     
    299299              "display detailed information about the current message",
    300300              "", ""),
    301  
     301
    302302  OWLCMD_ARGS("help", owl_command_help, OWL_CTX_INTERACTIVE,
    303303              "display help on using BarnOwl",
     
    330330              "scrolls receive window to specified position", "", ""),
    331331
    332   OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown, 
     332  OWLCMD_VOID("recv:pagedown", owl_function_mainwin_pagedown,
    333333              OWL_CTX_INTERACTIVE,
    334334              "scrolls down by a page", "", ""),
     
    346346
    347347  OWLCMD_INT ("recv:scroll", owl_function_page_curmsg, OWL_CTX_INTERACTIVE,
    348               "scrolls current message up or down", 
    349               "recv:scroll <numlines>", 
     348              "scrolls current message up or down",
     349              "recv:scroll <numlines>",
    350350              "Scrolls the current message up or down by <numlines>.\n"
    351351              "Scrolls up if <numlines> is negative, else scrolls down.\n"),
     
    396396
    397397  OWLCMD_VOID("last", owl_command_last, OWL_CTX_INTERACTIVE,
    398               "move the pointer to the last message", "", 
     398              "move the pointer to the last message", "",
    399399              "Moves the pointer to the last message in the view.\n"
    400400              "If we are already at the last message in the view,\n"
     
    509509  OWLCMD_VOID("status", owl_command_status, OWL_CTX_ANY,
    510510              "print status information about the running BarnOwl", "", ""),
    511  
     511
    512512  OWLCMD_ARGS("zlocate", owl_command_zlocate, OWL_CTX_INTERACTIVE,
    513513              "locate a user",
    514               "zlocate [-d] <user> ...", 
     514              "zlocate [-d] <user> ...",
    515515              "Performs a zlocate on one ore more users and puts the result\n"
    516516              "int a popwin.  If -d is specified, does not authenticate\n"
    517517              "the lookup request.\n"),
    518  
     518
    519519  OWLCMD_ARGS("filter", owl_command_filter, OWL_CTX_ANY,
    520520              "create a message filter",
     
    674674              "Show errors will show a list of errors encountered by BarnOwl.\n\n"
    675675              "SEE ALSO: filter, view, alias, bindkey, help\n"),
    676  
     676
    677677  OWLCMD_ARGS("delete", owl_command_delete, OWL_CTX_INTERACTIVE,
    678678              "mark a message for deletion",
     
    799799  /****************************************************************/
    800800
    801   OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword, 
     801  OWLCMD_VOID_CTX("edit:move-next-word", owl_editwin_move_to_nextword,
    802802                  OWL_CTX_EDIT,
    803803                  "moves cursor forward a word",
    804804                  "", ""),
    805805
    806   OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword, 
     806  OWLCMD_VOID_CTX("edit:move-prev-word", owl_editwin_move_to_previousword,
    807807                  OWL_CTX_EDIT,
    808808                  "moves cursor backwards a word",
     
    814814                  "", ""),
    815815
    816   OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end, 
     816  OWLCMD_VOID_CTX("edit:move-to-buffer-end", owl_editwin_move_to_end,
    817817                  OWL_CTX_EDIT,
    818818                  "moves cursor to the bottom right (end) of the buffer",
    819819                  "", ""),
    820820
    821   OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end, 
     821  OWLCMD_VOID_CTX("edit:move-to-line-end", owl_editwin_move_to_line_end,
    822822                  OWL_CTX_EDIT,
    823823                  "moves cursor to the end of the line",
    824824                  "", ""),
    825825
    826   OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start, 
     826  OWLCMD_VOID_CTX("edit:move-to-line-start", owl_editwin_move_to_line_start,
    827827                  OWL_CTX_EDIT,
    828828                  "moves cursor to the beginning of the line",
    829829                  "", ""),
    830830
    831   OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left, 
     831  OWLCMD_VOID_CTX("edit:move-left", owl_editwin_key_left,
    832832                  OWL_CTX_EDIT,
    833833                  "moves the cursor left by a character",
     
    854854                  "", ""),
    855855
    856   OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char, 
     856  OWLCMD_VOID_CTX("edit:delete-next-char", owl_editwin_delete_char,
    857857                  OWL_CTX_EDIT,
    858858                  "deletes the character to the right of the cursor",
     
    864864                  "", ""),
    865865
    866   OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear, 
     866  OWLCMD_VOID_CTX("edit:delete-all", owl_editwin_clear,
    867867                  OWL_CTX_EDIT,
    868868                  "deletes all of the contents of the buffer",
     
    874874                  "", ""),
    875875
    876   OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph, 
     876  OWLCMD_VOID_CTX("edit:fill-paragraph", owl_editwin_fill_paragraph,
    877877                  OWL_CTX_EDIT,
    878878                  "fills the current paragraph to line-wrap well",
    879879                  "", ""),
    880880
    881   OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter, 
     881  OWLCMD_VOID_CTX("edit:recenter", owl_editwin_recenter,
    882882                  OWL_CTX_EDIT,
    883883                  "recenters the buffer",
    884884                  "", ""),
    885885
    886   OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text, 
     886  OWLCMD_ARGS_CTX("edit:insert-text", owl_command_edit_insert_text,
    887887                  OWL_CTX_EDIT,
    888888                  "inserts text into the buffer",
    889889                  "edit:insert-text <text>", ""),
    890890
    891   OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel, 
     891  OWLCMD_VOID_CTX("edit:cancel", owl_command_edit_cancel,
    892892                  OWL_CTX_EDIT,
    893893                  "cancels the current command",
    894894                  "", ""),
    895895
    896   OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next, 
     896  OWLCMD_VOID_CTX("edit:history-next", owl_command_edit_history_next,
    897897                  OWL_CTX_EDIT,
    898898                  "replaces the text with the next history",
    899899                  "", ""),
    900900
    901   OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev, 
     901  OWLCMD_VOID_CTX("edit:history-prev", owl_command_edit_history_prev,
    902902                  OWL_CTX_EDIT,
    903903                  "replaces the text with the previous history",
     
    932932  OWLCMD_ALIAS   ("editresponse:done", "edit:done"),
    933933
    934   OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up, 
     934  OWLCMD_VOID_CTX("edit:move-up-line", owl_editwin_key_up,
    935935                  OWL_CTX_EDITMULTI,
    936936                  "moves the cursor up one line",
    937937                  "", ""),
    938938
    939   OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down, 
     939  OWLCMD_VOID_CTX("edit:move-down-line", owl_editwin_key_down,
    940940                  OWL_CTX_EDITMULTI,
    941941                  "moves the cursor down one line",
    942942                  "", ""),
    943943
    944   OWLCMD_VOID_CTX("edit:done", owl_command_edit_done, 
     944  OWLCMD_VOID_CTX("edit:done", owl_command_edit_done,
    945945                  OWL_CTX_EDIT,
    946946                  "Finishes entering text in the editwin.",
    947947                  "", ""),
    948948
    949   OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete, 
     949  OWLCMD_VOID_CTX("edit:done-or-delete", owl_command_edit_done_or_delete,
    950950                  OWL_CTX_EDITMULTI,
    951951                  "completes the command, but only if at end of message",
    952                   "", 
     952                  "",
    953953                  "If only whitespace is to the right of the cursor,\n"
    954954                  "runs 'edit:done'.\n"\
     
    971971  /****************************************************************/
    972972
    973   OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown, 
     973  OWLCMD_VOID_CTX("popless:scroll-down-page", owl_viewwin_pagedown,
    974974                  OWL_CTX_POPLESS,
    975975                  "scrolls down one page",
    976976                  "", ""),
    977977
    978   OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown, 
     978  OWLCMD_VOID_CTX("popless:scroll-down-line", owl_viewwin_linedown,
    979979                  OWL_CTX_POPLESS,
    980980                  "scrolls down one line",
    981981                  "", ""),
    982982
    983   OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup, 
     983  OWLCMD_VOID_CTX("popless:scroll-up-page", owl_viewwin_pageup,
    984984                  OWL_CTX_POPLESS,
    985985                  "scrolls up one page",
    986986                  "", ""),
    987987
    988   OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup, 
     988  OWLCMD_VOID_CTX("popless:scroll-up-line", owl_viewwin_lineup,
    989989                  OWL_CTX_POPLESS,
    990990                  "scrolls up one line",
    991991                  "", ""),
    992992
    993   OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top, 
     993  OWLCMD_VOID_CTX("popless:scroll-to-top", owl_viewwin_top,
    994994                  OWL_CTX_POPLESS,
    995995                  "scrolls to the top of the buffer",
    996996                  "", ""),
    997997
    998   OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom, 
     998  OWLCMD_VOID_CTX("popless:scroll-to-bottom", owl_viewwin_bottom,
    999999                  OWL_CTX_POPLESS,
    10001000                  "scrolls to the bottom of the buffer",
    10011001                  "", ""),
    10021002
    1003   OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right, 
     1003  OWLCMD_INT_CTX ("popless:scroll-right", owl_viewwin_right,
    10041004                  OWL_CTX_POPLESS,
    10051005                  "scrolls right in the buffer",
    10061006                  "popless:scroll-right <num-chars>", ""),
    10071007
    1008   OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left, 
     1008  OWLCMD_INT_CTX ("popless:scroll-left", owl_viewwin_left,
    10091009                  OWL_CTX_POPLESS,
    10101010                  "scrolls left in the buffer",
    10111011                  "popless:scroll-left <num-chars>", ""),
    10121012
    1013   OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit, 
     1013  OWLCMD_VOID_CTX("popless:quit", owl_command_popless_quit,
    10141014                  OWL_CTX_POPLESS,
    10151015                  "exits the popless window",
     
    10661066    return NULL;
    10671067  }
    1068  
     1068
    10691069  owl_function_help_for_command(argv[1]);
    10701070  return NULL;
     
    12521252{
    12531253  char *filename;
    1254  
     1254
    12551255  if (argc!=2) {
    12561256    owl_function_makemsg("usage: dump <filename>");
     
    12811281    if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) {
    12821282      skip_deleted=1;
    1283       argc-=1; argv+=1; 
     1283      argc-=1; argv+=1;
    12841284    } else if (argc>=1 && !strcmp(argv[1], "--last-if-none")) {
    12851285      last_if_none=1;
    1286       argc-=1; argv+=1; 
     1286      argc-=1; argv+=1;
    12871287    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    12881288      filter = g_strdup(argv[2]);
    1289       argc-=2; argv+=2; 
     1289      argc-=2; argv+=2;
    12901290    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    12911291      filter = owl_function_smartfilter(0, 0);
    1292       argc-=2; argv+=2; 
     1292      argc-=2; argv+=2;
    12931293    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    12941294      filter = owl_function_smartfilter(1, 0);
    1295       argc-=2; argv+=2; 
     1295      argc-=2; argv+=2;
    12961296    } else {
    12971297      owl_function_makemsg("Invalid arguments to command 'next'.");
     
    13111311    if (argc>=1 && !strcmp(argv[1], "--skip-deleted")) {
    13121312      skip_deleted=1;
    1313       argc-=1; argv+=1; 
     1313      argc-=1; argv+=1;
    13141314    } else if (argc>=1 && !strcmp(argv[1], "--first-if-none")) {
    13151315      first_if_none=1;
    1316       argc-=1; argv+=1; 
     1316      argc-=1; argv+=1;
    13171317    } else if (argc>=2 && !strcmp(argv[1], "--filter")) {
    13181318      filter = g_strdup(argv[2]);
    1319       argc-=2; argv+=2; 
     1319      argc-=2; argv+=2;
    13201320    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter")) {
    13211321      filter = owl_function_smartfilter(0, 0);
    1322       argc-=2; argv+=2; 
     1322      argc-=2; argv+=2;
    13231323    } else if (argc>=2 && !strcmp(argv[1], "--smart-filter-instance")) {
    13241324      filter = owl_function_smartfilter(1, 0);
    1325       argc-=2; argv+=2; 
     1325      argc-=2; argv+=2;
    13261326   } else {
    13271327      owl_function_makemsg("Invalid arguments to command 'prev'.");
     
    13871387    filtname = owl_function_smartfilter(1, 0);
    13881388  } else {
    1389     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     1389    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
    13901390  }
    13911391  return filtname;
     
    15821582    owl_function_printallvars();
    15831583    return NULL;
    1584   } 
     1584  }
    15851585
    15861586  if (argc > 1 && !strcmp("-q",argv[1])) {
     
    16561656
    16571657  var=argv[1];
    1658    
     1658
    16591659  v = owl_variable_get_var(owl_global_get_vardict(&g), var);
    16601660  if (v) {
     
    17081708  int  i;
    17091709  if (argc < 2) {
    1710     owl_function_makemsg("Invalid arguments to 'multi' command.");   
     1710    owl_function_makemsg("Invalid arguments to 'multi' command.");
    17111711    return NULL;
    17121712  }
     
    17181718        break;
    17191719      } else if (newbuff[i] != ' ') {
    1720         owl_function_makemsg("Invalid arguments to 'multi' command.");   
     1720        owl_function_makemsg("Invalid arguments to 'multi' command.");
    17211721        g_free(newbuff);
    17221722        return NULL;
     
    20122012  const char *const *myargv;
    20132013  int myargc;
    2014  
     2014
    20152015  if (!owl_global_is_aimloggedin(&g)) {
    20162016    owl_function_error("You are not logged in to AIM.");
     
    20642064{
    20652065  int edit=0;
    2066  
     2066
    20672067  if (argc>=2 && !strcmp("-e", argv[1])) {
    20682068    edit=1;
     
    20712071  }
    20722072
    2073   if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) {   
     2073  if ((argc==1) || (argc==2 && !strcmp(argv[1], "all"))) {
    20742074    owl_function_reply(0, !edit);
    20752075  } else if (argc==2 && !strcmp(argv[1], "sender")) {
     
    20782078    const owl_message *m;
    20792079    const owl_view    *v;
    2080     v = owl_global_get_current_view(&g);   
     2080    v = owl_global_get_current_view(&g);
    20812081    m = owl_view_get_element(v, owl_global_get_curmsg(&g));
    20822082    if (m) owl_zephyr_zaway(m);
     
    20962096{
    20972097  int auth;
    2098  
     2098
    20992099  if (argc<2) {
    21002100    owl_function_makemsg("Too few arguments for zlocate command");
     
    22122212      return(NULL);
    22132213    }
    2214    
     2214
    22152215  }
    22162216  return(NULL);
     
    22302230      owl_function_show_filter(argv[2]);
    22312231    }
    2232   } else if (argc==2 
     2232  } else if (argc==2
    22332233             && (!strcmp(argv[1], "zpunts") || !strcmp(argv[1], "zpunted"))) {
    22342234    owl_function_show_zpunts();
     
    22752275  } else if (!strcmp(argv[1], "startup")) {
    22762276    const char *filename;
    2277    
     2277
    22782278    filename=owl_global_get_startupfile(&g);
    22792279    owl_function_popless_file(filename);
     
    23322332  if (argc>1 && !strcmp(argv[1], "--no-move")) {
    23332333    move_after = 0;
    2334     argc--; 
     2334    argc--;
    23352335    argv++;
    23362336  }
     
    23932393  if (argc>1 && !strcmp(argv[1], "--no-move")) {
    23942394    move_after = 0;
    2395     argc--; 
     2395    argc--;
    23962396    argv++;
    23972397  }
     
    24342434{
    24352435  char *filtname;
    2436  
     2436
    24372437  if (argc < 3 || argc > 4) {
    24382438    owl_function_makemsg("Wrong number of arguments to colorclass command");
     
    25042504    owl_function_smartzpunt(1);
    25052505  } else {
    2506     owl_function_makemsg("Wrong number of arguments for %s", argv[0]);   
     2506    owl_function_makemsg("Wrong number of arguments for %s", argv[0]);
    25072507  }
    25082508  return NULL;
     
    25982598    buffstart=skiptokens(buff, 2);
    25992599  }
    2600    
     2600
    26012601  if (argc==1 || (argc==2 && !strcmp(argv[1], "-r"))) {
    26022602    /* When continuing a search, don't consider the current message. */
     
    26062606    owl_function_search_helper(true, direction);
    26072607  }
    2608  
     2608
    26092609  return(NULL);
    26102610}
     
    26162616  buffstart=skiptokens(buff, 1);
    26172617  owl_function_set_search(*buffstart ? buffstart : NULL);
    2618  
     2618
    26192619  return(NULL);
    26202620}
Note: See TracChangeset for help on using the changeset viewer.