/[mailutils]/mailutils/mh/repl.c
ViewVC logotype

Diff of /mailutils/mh/repl.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.4 by gray, Fri Dec 27 19:31:06 2002 UTC revision 1.5 by gray, Sat Jan 11 22:23:32 2003 UTC
# Line 36  static char args_doc[] = N_("[+folder] [ Line 36  static char args_doc[] = N_("[+folder] [
36  static struct argp_option options[] = {  static struct argp_option options[] = {
37    {"annotate", 'a', N_("BOOL"), OPTION_ARG_OPTIONAL,    {"annotate", 'a', N_("BOOL"), OPTION_ARG_OPTIONAL,
38     N_("Add Replied: header to the message being replied to")},     N_("Add Replied: header to the message being replied to")},
39      {"build", 'b', 0, 0,
40       N_("Build the draft and quit immediately.")},
41    {"draftfolder", 'd', N_("FOLDER"), 0,    {"draftfolder", 'd', N_("FOLDER"), 0,
42     N_("Invoke the draftfolder facility")},     N_("Specify the folder for message drafts")},
43      {"nodraftfolder", ARG_NODRAFTFOLDER, 0, 0,
44       N_("Undo the effect of the last --draftfolder option")},
45    {"draftmessage" , 'm', N_("MSG"), 0,    {"draftmessage" , 'm', N_("MSG"), 0,
46     N_("Invoke the draftmessage facility")},     N_("Invoke the draftmessage facility")},
47    {"cc",       'c', "{all|to|cc|me}", 0,    {"cc",       'c', "{all|to|cc|me}", 0,
# Line 51  static struct argp_option options[] = { Line 55  static struct argp_option options[] = {
55    {"filter", ARG_FILTER, N_("PROG"), 0,    {"filter", ARG_FILTER, N_("PROG"), 0,
56     N_("Set the filter program to preprocess the body of the message being replied")},     N_("Set the filter program to preprocess the body of the message being replied")},
57    {"form",   'F', N_("FILE"), 0, N_("Read format from given file")},    {"form",   'F', N_("FILE"), 0, N_("Read format from given file")},
58    {"inplace", ARG_INPLACE, N_("BOOL"), 0, N_("Annotate the message in place")},    {"inplace", ARG_INPLACE, N_("BOOL"), OPTION_ARG_OPTIONAL,
59    {"query", ARG_QUERY, N_("BOOL"), 0, N_("Query for addresses to place in To: and Cc: lists")},     N_("Annotate the message in place")},
60      {"query", ARG_QUERY, N_("BOOL"), OPTION_ARG_OPTIONAL,
61       N_("Query for addresses to place in To: and Cc: lists")},
62    {"width", 'w', N_("NUMBER"), 0, N_("Set output width")},    {"width", 'w', N_("NUMBER"), 0, N_("Set output width")},
63    {"whatnowproc", ARG_WHATNOWPROC, N_("PROG"), 0,    {"whatnowproc", ARG_WHATNOWPROC, N_("PROG"), 0,
64     N_("Set the replacement for whatnow program")},     N_("Set the replacement for whatnow program")},
# Line 63  static struct argp_option options[] = { Line 69  static struct argp_option options[] = {
69  /* Traditional MH options */  /* Traditional MH options */
70  struct mh_option mh_option[] = {  struct mh_option mh_option[] = {
71    {"annotate", 1, 'a', MH_OPT_BOOL },    {"annotate", 1, 'a', MH_OPT_BOOL },
72      {"build", 1, 'b', },
73    {"cc", 1, 'c', MH_OPT_ARG, "all/to/cc/me"},    {"cc", 1, 'c', MH_OPT_ARG, "all/to/cc/me"},
74    {"nocc", 3, 'n', MH_OPT_ARG, "all/to/cc/me"},    {"nocc", 3, 'n', MH_OPT_ARG, "all/to/cc/me"},
75    {"form",    4,  'F', MH_OPT_ARG, "formatfile"},    {"form",    4,  'F', MH_OPT_ARG, "formatfile"},
# Line 94  static char *format_str = Line 101  static char *format_str =
101    
102  static mh_format_t format;  static mh_format_t format;
103  static int width = 80;  static int width = 80;
104    static char *draft_folder;
105  static char *draft_file;  static char *draft_file;
106  static mh_msgset_t msgset;  static mh_msgset_t msgset;
107  static mailbox_t mbox;  static mailbox_t mbox;
108    static int build_only = 0; /* --build flag */
109    static int query_mode = 0; /* --query flag */
110    
111  static int  static int
112  opt_handler (int key, char *arg, void *unused)  opt_handler (int key, char *arg, void *unused)
113  {  {
114    switch (key)    switch (key)
115      {      {
116        case 'b':
117          build_only = 1;
118          break;
119          
120        case 'd':
121          draft_folder = arg;
122          break;
123          
124      case '+':      case '+':
125      case 'f':      case 'f':
126        current_folder = arg;        current_folder = arg;
# Line 121  opt_handler (int key, char *arg, void *u Line 139  opt_handler (int key, char *arg, void *u
139          }          }
140        break;        break;
141    
142        case ARG_NODRAFTFOLDER:
143          draft_folder = NULL;
144          break;
145    
146        case ARG_QUERY:
147          query_mode = is_true (arg);
148          break;
149          
150      case 'a':      case 'a':
     case 'd':  
151      case 'm':      case 'm':
152      case 'c':      case 'c':
153      case 'n':      case 'n':
# Line 131  opt_handler (int key, char *arg, void *u Line 156  opt_handler (int key, char *arg, void *u
156      case ARG_FCC:      case ARG_FCC:
157      case ARG_FILTER:      case ARG_FILTER:
158      case ARG_INPLACE:      case ARG_INPLACE:
     case ARG_QUERY:  
159      case ARG_WHATNOWPROC:      case ARG_WHATNOWPROC:
160        mh_error (_("option is not yet implemented"));        mh_error (_("option is not yet implemented"));
161        exit (1);        exit (1);
# Line 190  main (int argc, char **argv) Line 214  main (int argc, char **argv)
214        exit (1);        exit (1);
215      }      }
216    
217      if (!draft_folder)
218        draft_folder = mh_global_profile_get ("Draft-Folder", mu_path_folder_dir);
219      
220    mbox = mh_open_folder (current_folder, 0);    mbox = mh_open_folder (current_folder, 0);
221    mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");    mh_msgset_parse (mbox, &msgset, argc - index, argv + index, "cur");
222    if (msgset.count != 1)    if (msgset.count != 1)
# Line 198  main (int argc, char **argv) Line 225  main (int argc, char **argv)
225        return 1;        return 1;
226      }      }
227    
228    draft_file = mh_expand_name ("draft", 0);    draft_file = mh_expand_name (draft_folder, "reply", 0);
229        
230    make_draft ();    make_draft ();
231        

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26