source: CMT/HEAD/source/cmt_commands.cxx @ 459

Last change on this file since 459 was 459, checked in by rybkin, 16 years ago

See C.L. 360

  • Property svn:eol-style set to native
File size: 62.5 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// Modified by garonne@lal.in2p3.fr
5// See the complete license in cmt_license.txt "http://www.cecill.info".
6//-----------------------------------------------------------
7
8#include "cmt_commands.h"
9#include "cmt_tag.h"
10#include "cmt_symbol.h"
11#include "cmt_project.h"
12#include "cmt_log.h"
13
14ArgParser::ArgParser (CmtContext& context) : cmt(context), argc(0), argv(0), mode(Csh)
15{
16  arguments.clear ();
17
18  int i = 0;
19
20  parsers.add ("awk", i);
21  pv.push_back (&ArgParser::do_awk); i++;
22
23  parsers.add ("br", i);
24  parsers.add ("bro", i);
25  parsers.add ("broa", i);
26  parsers.add ("broad", i);
27  parsers.add ("broadc", i);
28  parsers.add ("broadca", i);
29  parsers.add ("broadcas", i);
30  parsers.add ("broadcast", i);
31  pv.push_back (&ArgParser::do_broadcast); i++;
32
33  parsers.add ("bu", i);
34  parsers.add ("bui", i);
35  parsers.add ("buil", i);
36  parsers.add ("build", i);
37  pv.push_back (&ArgParser::do_build); i++;
38
39  parsers.add ("check", i);
40  pv.push_back (&ArgParser::do_check); i++;
41
42  parsers.add ("check_f", i);
43  parsers.add ("check_fi", i);
44  parsers.add ("check_fil", i);
45  parsers.add ("check_file", i);
46  parsers.add ("check_files", i);
47  pv.push_back (&ArgParser::do_check_files); i++;
48
49  parsers.add ("co", i);
50  parsers.add ("checkout", i);
51  pv.push_back (&ArgParser::do_checkout); i++;
52
53  parsers.add ("cl", i);
54  parsers.add ("cle", i);
55  parsers.add ("clea", i);
56  parsers.add ("clean", i);
57  parsers.add ("cleanu", i);
58  parsers.add ("cleanup", i);
59  pv.push_back (&ArgParser::do_cleanup); i++;
60
61  parsers.add ("con", i);
62  parsers.add ("conf", i);
63  parsers.add ("confi", i);
64  parsers.add ("config", i);
65  pv.push_back (&ArgParser::do_config); i++;
66
67  parsers.add ("create", i);
68  pv.push_back (&ArgParser::do_create); i++;
69
70  parsers.add ("create_project", i);
71  pv.push_back (&ArgParser::do_create_project); i++;
72
73  parsers.add ("cvsb", i);
74  parsers.add ("cvsbr", i);
75  parsers.add ("cvsbra", i);
76  parsers.add ("cvsbran", i);
77  parsers.add ("cvsbranc", i);
78  parsers.add ("cvsbranch", i);
79  parsers.add ("cvsbranche", i);
80  parsers.add ("cvsbranches", i);
81  pv.push_back (&ArgParser::do_cvsbranches); i++;
82
83  parsers.add ("cvssubpa", i);
84  parsers.add ("cvssubpac", i);
85  parsers.add ("cvssubpack", i);
86  parsers.add ("cvssubpacka", i);
87  parsers.add ("cvssubpackag", i);
88  parsers.add ("cvssubpackage", i);
89  parsers.add ("cvssubpackages", i);
90  pv.push_back (&ArgParser::do_cvssubpackages); i++;
91
92  parsers.add ("cvssubpr", i);
93  parsers.add ("cvssubpro", i);
94  parsers.add ("cvssubproj", i);
95  parsers.add ("cvssubproje", i);
96  parsers.add ("cvssubprojec", i);
97  parsers.add ("cvssubproject", i);
98  parsers.add ("cvssubprojects", i);
99  pv.push_back (&ArgParser::do_cvssubprojects); i++;
100
101  parsers.add ("cvst", i);
102  parsers.add ("cvsta", i);
103  parsers.add ("cvstag", i);
104  parsers.add ("cvstags", i);
105  pv.push_back (&ArgParser::do_cvstags); i++;
106
107  parsers.add ("d", i);
108  parsers.add ("do", i);
109  pv.push_back (&ArgParser::do_do); i++;
110
111  parsers.add ("e", i);
112  parsers.add ("ex", i);
113  parsers.add ("exp", i);
114  parsers.add ("expa", i);
115  parsers.add ("expan", i);
116  parsers.add ("expand", i);
117  pv.push_back (&ArgParser::do_expand); i++;
118
119  parsers.add ("f", i);
120  parsers.add ("fi", i);
121  parsers.add ("fil", i);
122  parsers.add ("filt", i);
123  parsers.add ("filte", i);
124  parsers.add ("filter", i);
125  pv.push_back (&ArgParser::do_filter); i++;
126
127  parsers.add ("h", i);
128  parsers.add ("he", i);
129  parsers.add ("hel", i);
130  parsers.add ("help", i);
131  pv.push_back (&ArgParser::do_help); i++;
132
133  parsers.add ("l", i);
134  parsers.add ("lo", i);
135  parsers.add ("loc", i);
136  parsers.add ("lock", i);
137  pv.push_back (&ArgParser::do_lock); i++;
138
139  parsers.add ("rel", i);
140  parsers.add ("relo", i);
141  parsers.add ("reloc", i);
142  parsers.add ("reloca", i);
143  parsers.add ("relocat", i);
144  parsers.add ("relocate", i);
145  pv.push_back (&ArgParser::do_relocate); i++;
146
147  parsers.add ("rem", i);
148  parsers.add ("remo", i);
149  parsers.add ("remov", i);
150  parsers.add ("remove", i);
151  pv.push_back (&ArgParser::do_remove); i++;
152
153  parsers.add ("run", i);
154  pv.push_back (&ArgParser::do_run); i++;
155
156  parsers.add ("run_sequence", i);
157  pv.push_back (&ArgParser::do_run_sequence); i++;
158
159  parsers.add ("set", i);
160  pv.push_back (&ArgParser::do_set); i++;
161
162  parsers.add ("setup", i);
163  pv.push_back (&ArgParser::do_setup); i++;
164
165  parsers.add ("sh", i);
166  parsers.add ("sho", i);
167  parsers.add ("show", i);
168  pv.push_back (&ArgParser::do_show); i++;
169
170  parsers.add ("sy", i);
171  parsers.add ("sys", i);
172  parsers.add ("syst", i);
173  parsers.add ("syste", i);
174  parsers.add ("system", i);
175  pv.push_back (&ArgParser::do_system); i++;
176
177  parsers.add ("u", i);
178  parsers.add ("un", i);
179  parsers.add ("unl", i);
180  parsers.add ("unlo", i);
181  parsers.add ("unloc", i);
182  parsers.add ("unlock", i);
183  pv.push_back (&ArgParser::do_unlock); i++;
184
185  parsers.add ("v", i);
186  parsers.add ("ve", i);
187  parsers.add ("ver", i);
188  parsers.add ("vers", i);
189  parsers.add ("versi", i);
190  parsers.add ("versio", i);
191  parsers.add ("version", i);
192  parsers.add ("--version", i);
193  pv.push_back (&ArgParser::do_version); i++;
194
195  parsers.add ("-b", i);
196  parsers.add ("-ba", i);
197  parsers.add ("-bat", i);
198  pv.push_back (&ArgParser::option_bat); i++;
199
200  parsers.add ("-c", i);
201  parsers.add ("-cs", i);
202  parsers.add ("-csh", i);
203  pv.push_back (&ArgParser::option_csh); i++;
204
205  parsers.add ("-d", i);
206  parsers.add ("-di", i);
207  parsers.add ("-dis", i);
208  parsers.add ("-disa", i);
209  parsers.add ("-disab", i);
210  parsers.add ("-disabl", i);
211  parsers.add ("-disable", i);
212  parsers.add ("-disable_", i);
213  parsers.add ("-disable_w", i);
214  parsers.add ("-disable_wa", i);
215  parsers.add ("-disable_war", i);
216  parsers.add ("-disable_warn", i);
217  parsers.add ("-disable_warni", i);
218  parsers.add ("-disable_warnin", i);
219  parsers.add ("-disable_warning", i);
220  parsers.add ("-disable_warnings", i);
221  pv.push_back (&ArgParser::option_disable_warnings); i++;
222//Cmt::get_quiet ()
223
224  parsers.add ("-e", i);
225  pv.push_back (&ArgParser::option_e); i++;
226
227  parsers.add ("-f", i);
228  pv.push_back (&ArgParser::option_f); i++;
229
230  parsers.add ("-h", i);
231  parsers.add ("-he", i);
232  parsers.add ("-hel", i);
233  parsers.add ("-help", i);
234  parsers.add ("--h", i);
235  parsers.add ("--he", i);
236  parsers.add ("--hel", i);
237  parsers.add ("--help", i);
238  pv.push_back (&ArgParser::option_help); i++;
239
240  parsers.add ("-ho", i);
241  parsers.add ("-hom", i);
242  parsers.add ("-home", i);
243  pv.push_back (&ArgParser::option_home); i++;
244
245  parsers.add ("-n", i);
246  pv.push_back (&ArgParser::option_n); i++;
247
248  parsers.add ("-no_c", i);
249  parsers.add ("-no_cl", i);
250  parsers.add ("-no_cle", i);
251  parsers.add ("-no_clea", i);
252  parsers.add ("-no_clean", i);
253  parsers.add ("-no_cleanu", i);
254  parsers.add ("-no_cleanup", i);
255  pv.push_back (&ArgParser::option_no_cleanup); i++;
256
257  parsers.add ("-pac", i);
258  parsers.add ("-pack", i);
259  pv.push_back (&ArgParser::option_pack); i++;
260
261  parsers.add ("-pat", i);
262  parsers.add ("-path", i);
263  pv.push_back (&ArgParser::option_path); i++;
264
265  parsers.add ("-pr", i);
266  parsers.add ("-pri", i);
267  parsers.add ("-priv", i);
268  parsers.add ("-priva", i);
269  parsers.add ("-privat", i);
270  parsers.add ("-private", i);
271  pv.push_back (&ArgParser::option_private); i++;
272
273  parsers.add ("-pu", i);
274  parsers.add ("-pub", i);
275  parsers.add ("-publ", i);
276  parsers.add ("-publi", i);
277  parsers.add ("-public", i);
278  pv.push_back (&ArgParser::option_public); i++;
279
280  parsers.add ("-s", i);
281  parsers.add ("-sh", i);
282  pv.push_back (&ArgParser::option_sh); i++;
283
284  parsers.add ("-q", i);
285  parsers.add ("-qu", i);
286  parsers.add ("-qui", i);
287  parsers.add ("-quie", i);
288  parsers.add ("-quiet", i);
289  pv.push_back (&ArgParser::option_quiet); i++;
290
291  parsers.add ("-tag", i);
292  pv.push_back (&ArgParser::option_tag); i++;
293
294  parsers.add ("-tag_add", i);
295  pv.push_back (&ArgParser::option_tag_add); i++;
296
297  parsers.add ("-tag_remove", i);
298  pv.push_back (&ArgParser::option_tag_remove); i++;
299
300  parsers.add ("-u", i);
301  parsers.add ("-us", i);
302  parsers.add ("-use", i);
303  pv.push_back (&ArgParser::option_use); i++;
304
305  parsers.add ("-user", i);
306  parsers.add ("-user_", i);
307  parsers.add ("-user_c", i);
308  parsers.add ("-user_co", i);
309  parsers.add ("-user_con", i);
310  parsers.add ("-user_cont", i);
311  parsers.add ("-user_conte", i);
312  parsers.add ("-user_contex", i);
313  parsers.add ("-user_context", i);
314  pv.push_back (&ArgParser::option_user_context); i++;
315
316  parsers.add ("-v", i);
317  parsers.add ("-ve", i);
318  parsers.add ("-ver", i);
319  parsers.add ("-vers", i);
320  parsers.add ("-versi", i);
321  parsers.add ("-versio", i);
322  parsers.add ("-version", i);
323  pv.push_back (&ArgParser::option_version); i++;
324
325  parsers.add ("-warn", i);
326  parsers.add ("-warni", i);
327  parsers.add ("-warnin", i);
328  parsers.add ("-warning", i);
329  parsers.add ("-warnings", i);
330  pv.push_back (&ArgParser::option_warnings); i++;
331
332  parsers.add ("-with_v", i);
333  parsers.add ("-with_ve", i);
334  parsers.add ("-with_ver", i);
335  parsers.add ("-with_vers", i);
336  parsers.add ("-with_versi", i);
337  parsers.add ("-with_versio", i);
338  parsers.add ("-with_version", i);
339  parsers.add ("-with_version_", i);
340  parsers.add ("-with_version_d", i);
341  parsers.add ("-with_version_di", i);
342  parsers.add ("-with_version_dir", i);
343  parsers.add ("-with_version_dire", i);
344  parsers.add ("-with_version_direc", i);
345  parsers.add ("-with_version_direct", i);
346  parsers.add ("-with_version_directo", i);
347  parsers.add ("-with_version_director", i);
348  parsers.add ("-with_version_directory", i);
349  pv.push_back (&ArgParser::option_with_version_directory); i++;
350
351  parsers.add ("-without_v", i);
352  parsers.add ("-without_ve", i);
353  parsers.add ("-without_ver", i);
354  parsers.add ("-without_vers", i);
355  parsers.add ("-without_versi", i);
356  parsers.add ("-without_versio", i);
357  parsers.add ("-without_version", i);
358  parsers.add ("-without_version_", i);
359  parsers.add ("-without_version_d", i);
360  parsers.add ("-without_version_di", i);
361  parsers.add ("-without_version_dir", i);
362  parsers.add ("-without_version_dire", i);
363  parsers.add ("-without_version_direc", i);
364  parsers.add ("-without_version_direct", i);
365  parsers.add ("-without_version_directo", i);
366  parsers.add ("-without_version_director", i);
367  parsers.add ("-without_version_directory", i);
368  pv.push_back (&ArgParser::option_without_version_directory); i++;
369
370}
371
372void ArgParser::shift ()
373{
374  if (argc > 0)
375    {
376      argc--;
377      argv++;
378    }
379}
380
381void ArgParser::unshift ()
382{
383  argc++;
384  argv--;
385}
386
387void ArgParser::fill_arguments ()
388{
389  while (argc > 0)
390    {
391      cmt_string& s = arguments.add ();
392      s = argv[0];
393
394      //cerr << "Getting arg[" << s << "] " << endl;
395
396      shift ();
397    } 
398}
399
400cmt_string& ArgParser::fill_one_argument ()
401{
402  if (argc > 0)
403    {
404      cmt_string& s = arguments.add ();
405      s = argv[0];
406
407      //cerr << "Getting arg[" << s << "] " << endl;
408
409      shift ();
410
411      return (s);
412    }
413  else
414    {
415      static cmt_string empty = "";
416      return (empty);
417    }
418}
419
420cmt_string& ArgParser::fill_one_argument_filtered ()
421{
422  if (argc > 0)
423    {
424      cmt_string& s = arguments.add ();
425      s = argv[0];
426
427      if (s[0] == '-')
428        {
429          s = "";
430        }
431
432      //cerr << "Getting arg[" << s << "] " << endl;
433
434      shift ();
435
436      return (s);
437    }
438  else
439    {
440      static cmt_string empty = "";
441      return (empty);
442    }
443}
444
445void ArgParser::parse ()
446{
447  ArgParser& me = *this;
448
449  help_action = action_none;
450  arguments.clear ();
451  extra_line.erase (0);
452  extra_file.erase (0);
453  mode = Csh;
454
455  /// Skip first argument ("cmt")
456  shift ();
457
458  cmt.m_action = action_none;
459
460  while (argc > 0)
461    {
462      arg = argv[0];
463
464      shift ();
465
466      /// Suppress trailing carriage-return
467      int cr = arg.find ('\r');
468      if (cr != cmt_string::npos) arg.erase (cr);
469
470      /// Suppress enclosing quotes
471      if ((arg[0] == '\"') && (arg[arg.size () - 1] == '\"'))
472        {
473          arg.erase (0, 1);
474          arg.erase (arg.size () - 1, 1);
475        }
476
477      /// Detect and split arguments of the form a=b
478      /// left and right part of this argument
479      cmt_string reduced_arg = arg;
480      int pos = reduced_arg.find ('=');
481      if (pos != cmt_string::npos)
482        {
483          reduced_arg.erase (pos);
484          arg.erase (0, pos+1);
485        }
486      else
487        {
488          arg = "";
489        }
490
491      // cerr << "argc=" << argc << " reduced_arg=[" << reduced_arg << "] arg=[" << arg << "]" << endl;
492
493      if (parsers.has (reduced_arg))
494        {
495          // This argument corresponds to a known command
496
497          int i = (*parsers.find (reduced_arg));
498
499          parser p = pv[i];
500          (me.*p) ();
501        }
502      else if (cmt.m_action != action_none)
503        {
504          // We have unexpected arguments (not handled by the command handler). This may sign
505          // an unprotected handler implementation.
506          CmtMessage::warning ("unexpected parameter " + reduced_arg);
507          //      if (!cmt.m_quiet) cerr << "#CMT> warning : unexpected parameter " << reduced_arg << endl;
508        }
509      else
510        {
511          // This argument does not correspond to a known command. We expect then an action
512          // to be executed with that name
513
514          unshift ();
515          do_do ();
516
517          /*
518              if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad command parameter " << arg << endl;
519              help_action = action_none;
520          */
521        }
522    }
523}
524
525void ArgParser::do_awk ()
526{
527  fill_arguments ();
528  cmt.m_action = action_awk;
529}
530
531void ArgParser::do_broadcast ()
532{
533  fill_arguments ();
534  cmt.m_action = action_broadcast;
535 
536  if (cmt.m_scope_filtering_mode == default_filtering_mode)
537    {
538      cmt.m_scope_filtering_mode = reach_private_uses;
539    }
540}
541
542void ArgParser::do_build ()
543{
544  if (argc > 0)
545    {
546      arg = argv[0];
547
548      if (arg == "-nmake")
549        {
550          cmt.m_build_nmake = true;
551          shift ();
552        }
553    }
554
555  if (argc > 0)
556    {
557      arg = argv[0];
558
559      shift ();
560
561      if (arg == "constituent_makefile")
562        {
563          //      if (argc > 0)
564          if (argc == 1 || (argc == 2 && cmt_string (argv[0]).substr (0, 5) == "-out="))
565            {
566              //fill_one_argument ();
567              fill_arguments ();
568              cmt.m_action = action_build_constituent_makefile;
569            }
570          else if (argc > 0)
571            {
572              CmtMessage::error ("syntax: wrong arguments");
573//            if (!cmt.m_quiet) cerr << "#CMT> syntax error : wrong arguments" << endl;
574              cmt.m_action = action_build_constituent_makefile;
575              help_action = action_help;
576            }
577          else
578            {
579              CmtMessage::error ("syntax: constituent name missing");
580              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : constituent name missing" << endl;
581              cmt.m_action = action_build_constituent_makefile;
582              help_action = action_help;
583            }
584        }
585      else if (arg == "constituents_makefile")
586        {
587          fill_arguments ();
588          cmt.m_action = action_build_constituents_makefile;
589        }
590      else if (arg == "dependencies")
591        {
592          if (argc > 0)
593            {
594              fill_arguments ();
595              cmt.m_action = action_build_dependencies;
596            }
597          else
598            {
599              CmtMessage::error ("syntax: arguments missing");
600              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing " << endl;
601              help_action = action_help;
602              cmt.m_action = action_build_dependencies;
603            }
604        }
605      else if (arg == "library_links")
606        {
607          cmt.m_action = action_build_library_links;
608        }
609      else if (arg == "make_setup")
610        {
611          cmt.m_action = action_build_make_setup;
612        }
613      else if (arg == "msdev")
614        {
615          if (argc > 0)
616            {
617              fill_one_argument_filtered ();
618            }
619
620          cmt.m_action = action_build_msdev;
621        }
622      else if (arg == "CMT_pacman")
623        {
624          cmt.m_action = action_build_CMT_pacman;
625        }
626      else if (arg == "vsnet") 
627        {
628          if (argc > 0)
629            {
630              fill_one_argument_filtered ();
631            }
632                                                                   
633          cmt.m_action = action_build_vsnet;                 
634        }                                             
635      else if (arg == "os9_makefile")
636        {
637          if (argc > 0)
638            {
639              fill_one_argument ();
640              cmt.m_action = action_build_os9_makefile;
641            }
642          else
643            {
644              CmtMessage::error ("syntax: arguments missing");
645              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing " << endl;
646              help_action = action_help;
647              cmt.m_action = action_build_os9_makefile;
648            }
649        }
650      else if (arg == "prototype")
651        {
652          if (argc > 0)
653            {
654              fill_one_argument ();
655              cmt.m_action = action_build_prototype;
656            }
657          else
658            {
659              CmtMessage::error ("syntax: arguments missing");
660              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing" << endl;
661              help_action = action_help;
662              cmt.m_action = action_build_prototype;
663            }
664        }
665      else if (arg == "readme")
666        {
667          cmt.m_action = action_build_readme;
668
669          fill_arguments ();
670        }
671      else if (arg == "tag_makefile")
672        {
673          cmt.m_action = action_build_tag_makefile;
674        }
675      else if (arg == "temporary_name")
676        {
677          cmt.m_action = action_build_temporary_name;
678        }
679      else if (arg == "triggers")
680        {
681          if (argc > 0)
682            {
683              fill_one_argument ();
684              cmt.m_action = action_build_triggers;
685            }
686          else
687            {
688              CmtMessage::error ("syntax: arguments missing");
689              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing" << endl;
690              help_action = action_help;
691              cmt.m_action = action_build_triggers;
692            }
693        }
694      else if (arg == "windefs")
695        {
696          if (argc > 0)
697            {
698              fill_one_argument ();
699              cmt.m_action = action_build_windefs;
700            }
701          else
702            {
703              CmtMessage::error ("syntax: arguments missing");
704              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing" << endl;
705              help_action = action_help;
706              cmt.m_action = action_build_windefs;
707            }
708        }
709      else
710        {
711          CmtMessage::error ("syntax: wrong build argument");
712          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : wrong build argument" << endl;
713          help_action = action_help;
714          cmt.m_action = action_build;
715        }
716    }
717  else
718    {
719      CmtMessage::error ("syntax: don't know what to build");
720      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to build" << endl;
721      help_action = action_help;
722      cmt.m_action = action_build;
723    }
724}
725
726void ArgParser::do_check ()
727{
728  if (argc > 0)
729    {
730      arg = argv[0];
731
732      shift ();
733
734      if (arg == "configuration")
735        {
736          cmt.m_action = action_check_configuration;
737          //cmt.m_warnings = true;
738        }
739      else if (arg == "files")
740        {
741          if (argc > 0)
742            {
743              fill_one_argument ();
744              if (argc > 0)
745                {
746                  fill_one_argument ();
747                  cmt.m_action = action_check_files;
748                }
749              else
750                {
751                  CmtMessage::error ("syntax: reference file name missing");
752                  //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : reference file name missing" << endl;
753                  help_action = action_help;
754                  cmt.m_action = action_check_files;
755                }
756            }
757          else
758            {
759              CmtMessage::error ("syntax: file name missing");
760              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : file name missing" << endl;
761              help_action = action_help;
762              cmt.m_action = action_check_files;
763            }
764        }
765      else if (arg == "version")
766        {
767          if (argc > 0)
768            {
769              fill_one_argument ();
770              cmt.m_action = action_check_version;
771            }
772          else
773            {
774              CmtMessage::error ("syntax: package name missing");
775              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : package name missing" << endl;
776              help_action = action_help;
777              cmt.m_action = action_check_version;
778            }
779        }
780      else
781        {
782          CmtMessage::error ("syntax: bad check option");
783          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad check option" << endl;
784          help_action = action_help;
785          cmt.m_action = action_check;
786        }
787    }
788  else
789    {
790      CmtMessage::error ("syntax: don't know what to check");
791      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to check" << endl;
792      help_action = action_help;
793      cmt.m_action = action_check;
794    }
795}
796
797void ArgParser::do_check_files ()
798{
799  if (argc > 0)
800    {
801      fill_one_argument ();
802      if (argc > 0)
803        {
804          fill_one_argument ();
805          cmt.m_action = action_check_files;
806        }
807      else
808        {
809          CmtMessage::error ("syntax: reference file name missing");
810          help_action = action_help;
811          cmt.m_action = action_check_files;
812        }
813    }
814  else
815    {
816      CmtMessage::error ("syntax: file name missing");
817      help_action = action_help;
818      cmt.m_action = action_check_files;
819    }
820}
821
822void ArgParser::do_checkout ()
823{
824  if (argc > 0)
825    {
826      fill_arguments ();
827      cmt.m_action = action_checkout;
828    }
829  else
830    {
831      CmtMessage::error ("syntax: checkout arguments missing");
832      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : checkout arguments missing" << endl;
833      help_action = action_help;
834      cmt.m_action = action_checkout;
835    }
836}
837
838void ArgParser::do_cleanup ()
839{
840  cmt.m_action = action_cleanup;
841}
842
843void ArgParser::do_config ()
844{
845  cmt.m_action = action_config;
846}
847
848void ArgParser::do_create ()
849{
850  if (argc > 0)
851    {
852      fill_arguments ();
853      cmt.m_action = action_create;
854    }
855  else
856    {
857      CmtMessage::error ("syntax: create arguments missing");
858      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : create arguments missing" << endl;
859      help_action = action_help;
860      cmt.m_action = action_create;
861    }
862}
863
864void ArgParser::do_create_project ()
865{
866  if (argc > 0)
867    {
868      fill_arguments ();
869      cmt.m_action = action_create_project;
870    }
871  else
872    {
873      CmtMessage::error ("syntax: create_project arguments missing");
874      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : create_project arguments missing" << endl;
875      help_action = action_help;
876      cmt.m_action = action_create_project;
877    }
878}
879
880void ArgParser::do_cvsbranches ()
881{
882  if (argc > 0)
883    {
884      fill_one_argument ();
885      cmt.m_action = action_cvsbranches;
886    }
887  else
888    {
889      CmtMessage::error ("syntax: cvsbranches arguments missing");
890      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : cvsbranches arguments missing" << endl;
891      help_action = action_help;
892      cmt.m_action = action_cvsbranches;
893    }
894}
895
896void ArgParser::do_cvssubpackages ()
897{
898  if (argc > 0)
899    {
900      fill_one_argument ();
901    }
902
903  cmt.m_action = action_cvssubpackages;
904}
905
906void ArgParser::do_cvssubprojects ()
907{
908  if (argc > 0)
909    {
910      fill_one_argument ();
911    }
912
913  cmt.m_action = action_cvssubprojects;
914}
915
916void ArgParser::do_cvstags ()
917{
918  if (argc > 0)
919    {
920      fill_arguments ();
921      cmt.m_action = action_cvstags;
922    }
923  else
924    {
925      CmtMessage::error ("syntax: package name missing");
926      help_action = action_help;
927      cmt.m_action = action_cvstags;
928    }
929}
930
931void ArgParser::do_do ()
932{
933  if (argc > 0)
934    {
935      fill_arguments ();
936                 
937      {
938        cmt_string tag_name = "target_";
939        tag_name += arguments[0];
940
941        Tag* tag;
942        tag = Tag::add (tag_name, PriorityUserTag, "action", 0);                     
943        tag->mark ();
944      }
945
946      cmt.m_action = action_do;
947    }
948  else
949    {
950      CmtMessage::error ("syntax: action not specified");
951      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : action not specified" << endl;
952      help_action = action_help;
953      cmt.m_action = action_do;
954    }
955}
956
957void ArgParser::do_expand ()
958{
959  if (argc > 0)
960    {
961      arg = argv[0];
962
963      shift ();
964      if (arg == "model")
965        {
966          if (argc > 0)
967            {
968              fill_arguments ();
969              cmt.m_action = action_expand_model;
970            }
971          else
972            {
973              CmtMessage::error ("syntax: model not specified");
974              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : model not specified" << endl;
975              help_action = action_help;
976              cmt.m_action = action_expand_model;
977            }
978        }
979      else
980        {
981          CmtMessage::error ("syntax: bad expand option");
982          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad expand option" << endl;
983          help_action = action_help;
984          cmt.m_action = action_expand_model;
985        }
986    }
987  else
988    {
989      CmtMessage::error ("syntax: don't know what to expand");
990      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to expand" << endl;
991      help_action = action_help;
992      cmt.m_action = action_expand_model;
993    }
994}
995
996void ArgParser::do_filter ()
997{
998  if (argc > 0)
999    {
1000      fill_arguments ();
1001      cmt.m_action = action_filter;
1002    }
1003  else
1004    {
1005      CmtMessage::error ("syntax: file to filter not specified");
1006      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : file to filter not specified" << endl;
1007      help_action = action_help;
1008      cmt.m_action = action_filter;
1009    }
1010}
1011
1012void ArgParser::do_help ()
1013{
1014  help_action = action_help;
1015}
1016
1017void ArgParser::do_lock ()
1018{
1019  if (argc > 0)
1020    {
1021      cmt.m_current_package = fill_one_argument ();
1022      cmt.m_current_version.erase (0);
1023      cmt.m_current_path.erase (0);
1024
1025      if (argc > 0)
1026        {
1027          cmt.m_current_version = fill_one_argument ();
1028          cmt.m_action = action_lock;
1029
1030          if (argc > 0)
1031            {
1032              cmt.m_current_path = fill_one_argument_filtered ();
1033            }
1034
1035          cmt.m_current_access = UserMode;
1036          (Use::current()).set (cmt.m_current_package, 
1037                                cmt.m_current_version, 
1038                                cmt.m_current_path);
1039
1040        }
1041      else
1042        {
1043          CmtMessage::error ("syntax: version missing");
1044          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : version missing" << endl;
1045          help_action = action_help;
1046          cmt.m_action = action_lock;
1047        }
1048    }
1049  else
1050    {
1051      cmt.m_action = action_lock;
1052    }
1053}
1054
1055
1056void ArgParser::do_relocate ()
1057{
1058  cmt.m_action = action_relocate;
1059}
1060
1061
1062void ArgParser::do_remove ()
1063{
1064  if (argc > 0)
1065    {
1066      arg = argv[0];
1067
1068      if (arg == "library_links")
1069        {
1070          shift ();
1071          cmt.m_action = action_remove_library_links;
1072        }
1073      else
1074        {
1075          cmt.m_current_package = fill_one_argument ();
1076          cmt.m_current_version.erase (0);
1077          cmt.m_current_path.erase (0);
1078                     
1079          if (argc > 0)
1080            {
1081              cmt.m_current_version = fill_one_argument ();
1082
1083              if (argc > 0)
1084                {
1085                  cmt.m_current_path = fill_one_argument_filtered ();
1086                }
1087                           
1088              cmt.m_action = action_remove;
1089            }
1090          else
1091            {
1092              CmtMessage::error ("syntax: version missing");
1093              help_action = action_help;
1094              cmt.m_action = action_remove;
1095            }
1096        }
1097    }
1098  else
1099    {
1100      CmtMessage::error ("syntax: don't know what to remove");
1101      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to remove" << endl;
1102      help_action = action_help;
1103      cmt.m_action = action_remove;
1104    }
1105}
1106
1107void ArgParser::do_run ()
1108{
1109  if (argc > 0)
1110    {
1111      fill_arguments ();
1112      cmt.m_action = action_run;
1113    }
1114  else
1115    {
1116      CmtMessage::error ("syntax: run arguments missing");
1117      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : run arguments missing" << endl;
1118      help_action = action_help;
1119      cmt.m_action = action_run;
1120    }
1121}
1122
1123void ArgParser::do_run_sequence ()
1124{
1125  if (argc > 0)
1126    {
1127      fill_one_argument ();
1128      cmt.m_action = action_run_sequence;
1129    }
1130  else
1131    {
1132      CmtMessage::error ("syntax: run_sequence arguments missing");
1133      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : run_sequence arguments missing" << endl;
1134      help_action = action_help;
1135      cmt.m_action = action_run_sequence;
1136    }
1137}
1138
1139void ArgParser::do_set ()
1140{
1141  if (argc > 0)
1142    {
1143      arg = argv[0];
1144
1145      shift ();
1146
1147      if (arg == "version")
1148        {
1149          fill_arguments ();
1150          cmt.m_action = action_set_version;
1151        }
1152      else if (arg == "versions")
1153        {
1154          fill_arguments ();
1155
1156          cmt.m_action = action_set_versions;
1157
1158          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1159            {
1160              cmt.m_scope_filtering_mode = reach_private_uses;
1161            }
1162        }
1163      else
1164        {
1165          CmtMessage::error ("syntax: bad set argument");
1166          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad set argument" << endl;
1167          help_action = action_help;
1168          //cmt.m_action = action_set;
1169        }
1170    }
1171  else
1172    {
1173      CmtMessage::error ("syntax: don't know what to set");
1174      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to set" << endl;
1175      help_action = action_help;
1176      //cmt.m_action = action_set;
1177    }
1178}
1179
1180void ArgParser::do_setup ()
1181{
1182  cmt.m_action = action_setup;
1183  //cmt.m_warnings = true;
1184}
1185
1186void ArgParser::do_show ()
1187{
1188  if (argc > 0)
1189    {
1190      arg = argv[0];
1191
1192      //cerr << "Running show arg=" << arg << endl;
1193
1194      shift ();
1195
1196      if (arg == "action")
1197        {
1198          if (argc > 0)
1199            {
1200              cmt.m_current_target = fill_one_argument ();
1201              cmt.m_action = action_show_action;
1202            }
1203          else
1204            {
1205              CmtMessage::error ("syntax: action name missing");
1206              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : action name missing" << endl;
1207              help_action = action_help;
1208              cmt.m_action = action_show_action;
1209            }
1210        }
1211      else if (arg == "action_names")
1212        {
1213          if (argc > 0)
1214            {
1215              fill_one_argument ();
1216            }
1217
1218          cmt.m_action = action_show_action_names;
1219        }
1220      else if (arg == "action_value")
1221        {
1222          cmt.m_quiet = true;
1223          if (argc > 0)
1224            {
1225              cmt.m_current_target = fill_one_argument ();
1226              cmt.m_action = action_show_action_value;
1227            }
1228          else
1229            {
1230              CmtMessage::error ("syntax: action name missing");
1231              help_action = action_help;
1232              cmt.m_action = action_show_action_value;
1233            }
1234        }
1235      else if (arg == "actions")
1236        {
1237          if (argc > 0)
1238            {
1239              fill_one_argument ();
1240            }
1241
1242          cmt.m_action = action_show_actions;
1243        }
1244      else if (arg == "all_tags")
1245        {
1246          cmt.m_action = action_show_all_tags;
1247        }
1248      else if (arg == "applied_patterns")
1249        {
1250          cmt.m_action = action_show_applied_patterns;
1251        }
1252      else if (arg == "author")
1253        {
1254          cmt.m_action = action_show_author;
1255        }
1256      else if (arg == "branches")
1257        {
1258          cmt.m_action = action_show_branches;
1259        }
1260      else if (arg == "clients")
1261        {
1262          if (argc > 0)
1263            {
1264              cmt.m_current_target = fill_one_argument ();
1265
1266              cmt.m_action = action_show_clients;
1267
1268              if (argc > 0)
1269                {
1270                  fill_one_argument ();
1271                  if (argc > 0)
1272                    {
1273                      fill_one_argument ();
1274                    }
1275                }
1276            }
1277          else
1278            {
1279              CmtMessage::error ("syntax: package name missing");
1280              help_action = action_help;
1281              cmt.m_action = action_show_clients;
1282            }
1283        }
1284      else if (arg == "cmtpath_patterns")
1285        {
1286          cmt.m_action = action_show_cmtpath_patterns;
1287        }
1288      else if (arg == "constituent")
1289        {
1290          if (argc > 0)
1291            {
1292              cmt.m_current_target = fill_one_argument ();
1293              cmt.m_action = action_show_constituent;
1294            }
1295          else
1296            {
1297              CmtMessage::error ("syntax: constituent name missing");
1298              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : constituent name missing" << endl;
1299              help_action = action_help;
1300              cmt.m_action = action_show_constituent;
1301            }
1302        }
1303      else if (arg == "constituent_names")
1304        {
1305          cmt.m_action = action_show_constituent_names;
1306        }
1307      else if (arg == "constituents")
1308        {
1309          cmt.m_action = action_show_constituents;
1310        }
1311      else if (arg == "cycles")
1312        {
1313          cmt.m_action = action_show_cycles;
1314        }
1315      else if (arg == "fragment")
1316        {
1317          if (argc > 0)
1318            {
1319              cmt.m_current_target = fill_one_argument ();
1320              cmt.m_action = action_show_fragment;
1321            }
1322          else
1323            {
1324              CmtMessage::error ("syntax: fragment name missing");
1325              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : fragment name missing" << endl;
1326              help_action = action_help;
1327              cmt.m_action = action_show_fragment;
1328            }
1329        }
1330      else if (arg == "fragments")
1331        {
1332          cmt.m_action = action_show_fragments;
1333        }
1334      else if (arg == "groups")
1335        {
1336          cmt.m_action = action_show_groups;
1337        }
1338      else if (arg == "include_dirs")
1339        {
1340          cmt.m_action = action_show_include_dirs;
1341        }
1342      else if (arg == "language")
1343        {
1344          if (argc > 0)
1345            {
1346              cmt.m_current_target = fill_one_argument ();
1347              cmt.m_action = action_show_language;
1348            }
1349          else
1350            {
1351              CmtMessage::error ("syntax: language name missing");
1352              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : language name missing" << endl;
1353              help_action = action_help;
1354              cmt.m_action = action_show_language;
1355            }
1356        }
1357      else if (arg == "languages")
1358        {
1359          cmt.m_action = action_show_languages;
1360        }
1361      else if (arg == "macro")
1362        {
1363          if (argc > 0)
1364            {
1365              cmt.m_current_target = fill_one_argument ();
1366              cmt.m_action = action_show_macro;
1367            }
1368          else
1369            {
1370              CmtMessage::error ("syntax: macro name missing");
1371              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : macro name missing" << endl;
1372              help_action = action_help;
1373              cmt.m_action = action_show_macro;
1374            }
1375        }
1376      else if (arg == "macro_names")
1377        {
1378          if (argc > 0)
1379            {
1380              fill_one_argument ();
1381            }
1382
1383          cmt.m_action = action_show_macro_names;
1384        }
1385      else if (arg == "macro_value")
1386        {
1387          cmt.m_quiet = true;
1388          if (argc > 0)
1389            {
1390              cmt.m_current_target = fill_one_argument ();
1391              cmt.m_action = action_show_macro_value;
1392            }
1393          else
1394            {
1395              CmtMessage::error ("syntax: macro name missing");
1396              help_action = action_help;
1397              cmt.m_action = action_show_macro_value;
1398            }
1399        }
1400      else if (arg == "macros")
1401        {
1402          if (argc > 0)
1403            {
1404              fill_one_argument ();
1405            }
1406
1407          cmt.m_action = action_show_macros;
1408        }
1409      else if (arg == "manager")
1410        {
1411          cmt.m_action = action_show_manager;
1412        }
1413      else if (arg == "packages")
1414        {
1415          if (argc > 0)
1416            {
1417              cmt.m_current_target = fill_one_argument ();
1418            }
1419
1420          cmt.m_action = action_show_packages;
1421        }
1422      else if (arg == "path")
1423        {
1424          cmt.m_action = action_show_path;
1425        }
1426      else if (arg == "pattern")
1427        {
1428          if (argc > 0)
1429            {
1430              cmt.m_current_target = fill_one_argument ();
1431              cmt.m_action = action_show_pattern;
1432            }
1433          else
1434            {
1435              CmtMessage::error ("syntax: pattern name missing");
1436              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : pattern name missing" << endl;
1437              help_action = action_help;
1438              cmt.m_action = action_show_pattern;
1439            }
1440        }
1441      else if (arg == "pattern_names")
1442        {
1443          cmt.m_action = action_show_pattern_names;
1444        }
1445      else if (arg == "patterns")
1446        {
1447          cmt.m_action = action_show_patterns;
1448        }
1449      else if (arg == "projects")
1450        {
1451          cmt.m_action = action_show_projects;
1452        }
1453        else if (arg == "project_author")
1454        {
1455          cmt.m_action = action_show_project_author;
1456        }
1457
1458      else if (arg == "pwd")
1459        {
1460          cmt.m_action = action_show_pwd;
1461        }
1462      else if (arg == "setup")
1463        {
1464          cmt.m_action = action_show_setup;
1465
1466          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1467            {
1468              cmt.m_scope_filtering_mode = reach_private_uses;
1469            }
1470        }
1471      else if (arg == "set_names")
1472        {
1473          if (argc > 0)
1474            {
1475              fill_one_argument ();
1476            }
1477
1478          cmt.m_action = action_show_set_names;
1479        }
1480      else if (arg == "set_value")
1481        {
1482          cmt.m_quiet = true;
1483          if (argc > 0)
1484            {
1485              cmt.m_current_target = fill_one_argument ();
1486              cmt.m_action = action_show_set_value;
1487            }
1488          else
1489            {
1490              CmtMessage::error ("syntax: set name missing");
1491              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : set name missing" << endl;
1492              help_action = action_help;
1493              cmt.m_action = action_show_set_value;
1494            }
1495        }
1496      else if (arg == "set")
1497        {
1498          if (argc > 0)
1499            {
1500              cmt.m_current_target = fill_one_argument ();
1501              cmt.m_action = action_show_set;
1502            }
1503          else
1504            {
1505              CmtMessage::error ("syntax: set name missing");
1506              help_action = action_help;
1507              cmt.m_action = action_show_set;
1508            }
1509        }
1510      else if (arg == "sets")
1511        {
1512          if (argc > 0)
1513            {
1514              fill_one_argument ();
1515            }
1516
1517          cmt.m_action = action_show_sets;
1518        }
1519      else if (arg == "strategies")
1520        {
1521          cmt.m_action = action_show_strategies;
1522        }
1523      else if (arg == "tags")
1524        {
1525          cmt.m_action = action_show_tags;
1526        }
1527      else if (arg == "use_paths")
1528        {
1529          if (argc > 0)
1530            {
1531              while (argc > 0)
1532                {
1533                  if (strcmp (argv[0], "-private") == 0)
1534                    {
1535                      cmt.m_scope_filtering_mode = reach_private_uses;
1536                    }
1537                  else if (strcmp (argv[0], "--private") == 0)
1538                    {
1539                      cmt.m_scope_filtering_mode = reach_private_uses;
1540                    }
1541                  else
1542                    {
1543                      cmt_string& s = arguments.add ();
1544                      s = argv[0];
1545                    }
1546
1547                  shift ();
1548                }
1549
1550              cmt.m_action = action_show_use_paths;
1551            }
1552          else
1553            {
1554              CmtMessage::error ("syntax: package name missing");
1555              help_action = action_help;
1556              cmt.m_action = action_show_use_paths;
1557            }
1558        }
1559      else if ((arg == "u") ||
1560               (arg == "us") ||
1561               (arg == "use") ||
1562               (arg == "uses"))
1563        {
1564          cmt.m_action = action_show_uses;
1565
1566          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1567            {
1568              cmt.m_scope_filtering_mode = reach_private_uses;
1569            }
1570        }
1571      else if (arg == "version")
1572        {
1573          cmt.m_action = action_show_version;
1574        }
1575      else if (arg == "versions")
1576        {
1577          if (argc > 0)
1578            {
1579              cmt.m_current_target = fill_one_argument ();
1580              cmt.m_action = action_show_versions;
1581            }
1582          else
1583            {
1584              CmtMessage::error ("syntax: package name missing");
1585              help_action = action_help;
1586              cmt.m_action = action_show_versions;
1587            }
1588        }
1589      else
1590        {
1591          CmtMessage::error ("syntax: bad show argument");
1592          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad show argument" << endl;
1593          help_action = action_help;
1594          cmt.m_action = action_show;
1595        }
1596    }
1597  else
1598    {
1599      CmtMessage::error ("syntax: don't know what to show");
1600      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to show" << endl;
1601      help_action = action_help;
1602      cmt.m_action = action_show;
1603    }
1604}
1605
1606void ArgParser::do_system ()
1607{
1608  cmt.m_action = action_system;
1609}
1610
1611void ArgParser::do_unlock ()
1612{
1613  if (argc > 0)
1614    {
1615      cmt.m_current_package = fill_one_argument ();
1616      cmt.m_current_version.erase (0);
1617      cmt.m_current_path.erase (0);
1618                                       
1619      if (argc > 0)
1620        {
1621          cmt.m_current_version = fill_one_argument ();
1622          cmt.m_action = action_unlock;
1623
1624          if (argc > 0)
1625            {
1626              cmt.m_current_path = fill_one_argument_filtered ();
1627            }
1628                                               
1629          cmt.m_current_access = UserMode;
1630          (Use::current()).set (cmt.m_current_package, 
1631                                cmt.m_current_version, 
1632                                cmt.m_current_path);
1633
1634        }
1635      else
1636        {
1637          CmtMessage::error ("syntax: version missing");
1638          help_action = action_help;
1639          cmt.m_action = action_unlock;
1640        }
1641    }
1642  else
1643    {
1644      cmt.m_action = action_unlock;
1645    }
1646}
1647
1648void ArgParser::do_version ()
1649{
1650  cmt.m_action = action_version;
1651}
1652
1653void ArgParser::option_help ()
1654{
1655  help_action = action_help;
1656}
1657
1658void ArgParser::option_n ()
1659{
1660  cmt.m_simulation = true;
1661}
1662
1663
1664void ArgParser::option_disable_warnings ()
1665{
1666  cmt.m_disable_warnings = true;
1667  if (CmtMessage::level () <= Warning)
1668    CmtMessage::set_level (Error);
1669}
1670
1671void ArgParser::option_quiet ()
1672{
1673  cmt.m_quiet = true;
1674  if (CmtMessage::level () <= Error)
1675    CmtMessage::set_level (Fatal);
1676}
1677
1678
1679void ArgParser::option_warnings ()
1680{
1681  cmt.m_warnings = true;
1682  if (CmtMessage::level () != Warning)
1683    CmtMessage::set_level (Warning);
1684}
1685
1686void ArgParser::option_csh ()
1687{
1688  mode = Csh;
1689}
1690
1691void ArgParser::option_sh ()
1692{
1693  mode = Sh;
1694}
1695
1696void ArgParser::option_bat ()
1697{
1698  mode = Bat;
1699}
1700
1701void ArgParser::option_use ()
1702{
1703  if (cmt.m_action != action_create)
1704    {
1705      CmtSystem::cmt_string_vector words;
1706
1707      CmtSystem::split (arg, ":", words);
1708
1709      cmt.m_current_access = UserMode;
1710
1711      if (words.size () > 0) cmt.m_current_package = words[0];
1712      if (words.size () > 1) cmt.m_current_version = words[1];
1713      if (words.size () > 2) cmt.m_current_path    = words[2];
1714      (Use::current()).set (cmt.m_current_package, 
1715                            cmt.m_current_version, 
1716                            cmt.m_current_path);
1717    }
1718}
1719
1720void ArgParser::option_pack ()
1721{
1722  if ((cmt.m_action != action_create) && (cmt.m_current_package != arg))
1723    {
1724      //CmtSystem::cd (cmt.m_default_path);
1725
1726      cmt.m_current_access = UserMode;
1727
1728      cmt.m_current_package = arg;
1729      cmt.m_current_version = "";
1730
1731      /*
1732      cerr << "ArgParser::option_pack> "
1733           << " cp=" << cmt.m_current_package
1734           << " cv=" << cmt.m_current_version
1735           << " cp=" << cmt.m_current_path << endl;
1736      */
1737
1738      (Use::current()).set (cmt.m_current_package, 
1739                            cmt.m_current_version, 
1740                            cmt.m_current_path);
1741    }
1742}
1743
1744void ArgParser::option_version ()
1745{
1746  if ((cmt.m_action != action_create) && (cmt.m_current_version != arg))
1747    {
1748      cmt.m_current_access = UserMode;
1749      cmt.m_current_version = arg;
1750
1751      /*
1752      cerr << "ArgParser::option_version> "
1753           << " cp=" << cmt.m_current_package
1754           << " cv=" << cmt.m_current_version
1755           << " cp=" << cmt.m_current_path << endl;
1756      */
1757
1758      (Use::current()).set (cmt.m_current_package, 
1759                            cmt.m_current_version, 
1760                            cmt.m_current_path);
1761    }
1762}
1763
1764void ArgParser::option_path ()
1765{
1766  if ((cmt.m_action != action_create) && (cmt.m_current_path != arg))
1767    {
1768      cmt.m_current_access = UserMode;
1769      cmt.m_current_path = arg;
1770
1771      /*
1772      cerr << "ArgParser::option_path> "
1773           << " cp=" << cmt.m_current_package
1774           << " cv=" << cmt.m_current_version
1775           << " cp=" << cmt.m_current_path << endl;
1776      */
1777
1778      (Use::current()).set (cmt.m_current_package, 
1779                            cmt.m_current_version, 
1780                            cmt.m_current_path);
1781
1782      //IProjectFactory& factory = ProjectFactory::instance ();
1783      //CmtSystem::add_cmt_path (cmt.m_current_path, "argument", factory);
1784    }
1785}
1786
1787void ArgParser::option_f ()
1788{
1789  extra_file = arg;
1790}
1791
1792void ArgParser::option_e ()
1793{
1794  CmtMessage::warning ("extra statement = " + arg);
1795  //  cerr << "#CMT> Warning: extra statement = " << arg << endl;
1796  extra_line = arg;
1797}
1798
1799void ArgParser::option_home ()
1800{
1801  if (CmtSystem::test_directory (arg))
1802    {
1803      cmt.m_cmt_home = arg;
1804    }
1805}
1806
1807void ArgParser::option_tag ()
1808{
1809  /*
1810    Here we are going to change the complete tag set
1811  */
1812  if (arg != "")
1813    {
1814      Tag* tag;
1815      CmtSystem::cmt_string_vector words;
1816
1817      // First reset selection of all existing tags
1818      //Tag::clear_all ();
1819      Tag::unmark_all ();
1820      cmt.m_extra_tags = ",";
1821                   
1822      // Then restore CMTSITE
1823      Cmt::configure_version_tag ();
1824      Cmt::configure_site_tag (0);
1825      Cmt::configure_uname_tag ();
1826      Cmt::configure_hosttype_tag ();
1827      Cmt::configure_config_tag ();
1828      Cmt::configure_home (0);
1829      Cmt::guess_current_project ();
1830
1831      CmtSystem::split (arg, " \t,", words);
1832                 
1833      for (int i = 0; i < words.size (); i++)
1834        {
1835          const cmt_string& a = words[i];
1836      //if (!cmt.m_quiet) cout  << "parse_argument(tag_add)> current_tag=" << a << endl;                     
1837          cmt_string s = ",";
1838          s += a;
1839          s += ",";
1840                     
1841          if (i == 0)
1842            {
1843              cmt.m_current_tag = a;
1844                         
1845              if (CmtSystem::testenv ("TAGDEBUG")) 
1846              cerr << "parse_argument(tag_add)> current_tag=" << cmt.m_current_tag << endl;
1847            }
1848                     
1849          if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1850            {
1851              //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1852                         
1853              // Then restore uname if the specified tag is CMTCONFIG
1854              if (a == CmtSystem::get_cmt_config ())
1855                {
1856                  Cmt::configure_uname_tag ();
1857                }
1858                         
1859              tag = Tag::add (a, PriorityArgument, "arguments", 0);
1860              tag->mark ();
1861              cmt.m_extra_tags += a;
1862              cmt.m_extra_tags += ",";
1863            }
1864        }
1865        // To be sure that a tag
1866        Cmt::guess_current_project ();
1867    }
1868}
1869
1870void ArgParser::option_tag_add ()
1871{
1872  Tag* tag;
1873  CmtSystem::cmt_string_vector words;
1874 
1875
1876  CmtSystem::split (arg, " \t,", words);
1877
1878  for (int i = 0; i < words.size (); i++)
1879    {
1880      const cmt_string& a = words[i];
1881
1882      cmt_string s = ",";
1883      s += a;
1884      s += ",";
1885
1886      if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1887        {
1888          //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1889
1890          /// Then restore uname if the specified tag is CMTCONFIG
1891          if (a == CmtSystem::get_cmt_config ())
1892            {
1893              Cmt::configure_uname_tag ();
1894            }
1895                     
1896          tag = Tag::add (a, PriorityUserTag, "arguments", 0);
1897                     
1898          tag->mark ();
1899
1900          cmt.m_extra_tags += a;
1901          cmt.m_extra_tags += ",";
1902        }
1903    }
1904}
1905
1906void ArgParser::option_tag_remove ()
1907{
1908  Tag::TagPtrVector tags = Tag::tags ();
1909  int i;
1910  Tag* tag;
1911
1912  /*
1913    for (i = 0; i < tags.size (); i++)
1914    {
1915    tag = tags[i];
1916    if ((tag != 0) &&
1917    (tag->selected))
1918    {
1919    if (!cmt.m_quiet) cerr << "  original tag_list=" << tag->name << tag->priority << endl;
1920    }
1921    }
1922  */
1923
1924  CmtSystem::cmt_string_vector words;
1925
1926  //if (!cmt.m_quiet) cerr << "-arg_remove=" << arg << endl;
1927
1928  CmtSystem::split (arg, " \t,", words);
1929
1930  //
1931  // Now erase all entries in the old list that match
1932  // the specified tags
1933  //
1934
1935  for (i = 0; i < words.size (); i++)
1936    {
1937      const cmt_string& a = words[i];
1938
1939      cmt_string s = ",";
1940      s += a;
1941      s += ",";
1942
1943      int pos;
1944
1945      pos = cmt.m_extra_tags.find (s);
1946
1947      if (pos != cmt_string::npos)
1948        {
1949          cmt.m_extra_tags.erase (pos, s.size () - 1);
1950        }
1951
1952      //if (!cmt.m_quiet) cerr << "  tag_list=[" << tag_list << "]" << endl;
1953    }
1954
1955  //
1956  // Now reinject the purged list of tags into the database
1957  // exactly as when using -tag=<tag-list>
1958  //
1959
1960  /// First forget about all existing tags
1961      Tag::unmark_all ();
1962
1963      /// Then restore CMTSITE
1964        Cmt::configure_version_tag ();
1965        Cmt::configure_site_tag (0);
1966        Cmt::configure_uname_tag ();
1967        Cmt::configure_hosttype_tag ();
1968             
1969        CmtSystem::split (cmt.m_extra_tags, " \t,", words);
1970
1971        for (i = 0; i < words.size (); i++)
1972          {
1973            const cmt_string& a = words[i];
1974
1975            //fprintf (stderr, "  a=[%s]\n", a.c_str ());
1976
1977            /// Then restore uname if the specified tag is CMTCONFIG
1978              if (a == CmtSystem::get_cmt_config ())
1979                {
1980                  Cmt::configure_uname_tag ();
1981                }
1982
1983              if (i == 0)
1984                {
1985                  cmt.m_current_tag = a;
1986
1987                  //if (!cmt.m_quiet) cerr << "parse_argument(tag_remove)> current_tag="
1988                  //<< cmt.m_current_tag << endl;
1989
1990                  tag = Tag::add (a, PriorityTag, "restore configuration", 0);
1991                }
1992              else
1993                {
1994                  tag = Tag::add (a, PriorityUserTag, "restore configuration", 0);
1995                }
1996
1997              tag->mark ();
1998          }
1999}
2000
2001void ArgParser::option_user_context ()
2002{
2003  if (CmtSystem::test_directory (arg))
2004    {
2005      cmt.m_cmt_user_context = arg;
2006    }
2007}
2008
2009void ArgParser::option_with_version_directory ()
2010{
2011  cmt.m_current_structuring_style = with_version_directory;
2012
2013  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2014  if (def != 0)
2015    {
2016      def->m_default_value = true;
2017      def->m_priority_value = false;
2018    }
2019}
2020
2021void ArgParser::option_without_version_directory ()
2022{
2023  cmt.m_current_structuring_style = without_version_directory;
2024
2025  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2026  if (def != 0)
2027    {
2028      def->m_default_value = false;
2029      def->m_priority_value = true;
2030    }
2031}
2032
2033void ArgParser::option_no_cleanup ()
2034{
2035  //cmt.m_current_setup_strategy |= SetupNoCleanup;
2036}
2037
2038void ArgParser::option_private ()
2039{
2040  cmt.m_scope_filtering_mode = reach_private_uses;
2041}
2042
2043void ArgParser::option_public ()
2044{
2045  cmt.m_scope_filtering_mode = block_private_uses;
2046}
2047
2048
2049
2050
2051
2052
2053CommandHelp::HelpMap& CommandHelp::get_help ()
2054{
2055  static CommandHelp& me = instance ();
2056
2057  return (me.m_help);
2058}
2059
2060CommandHelp::HelpTexts& CommandHelp::get_help_texts ()
2061{
2062  static CommandHelp& me = instance ();
2063
2064  return (me.m_help_texts);
2065}
2066
2067const cmt_string& CommandHelp::get_help_text (ActionType key)
2068{
2069  static const HelpTexts& help = get_help_texts ();
2070
2071  const cmt_string& h = help[key];
2072  return (h);
2073}
2074
2075void CommandHelp::show_all ()
2076{
2077  static HelpTexts& help_texts = get_help_texts ();
2078
2079  cerr << "#> cmt command [option...]" << endl;
2080  cerr << "# command :" << endl;
2081
2082  int i;
2083
2084  for (i = 0; ; i++)
2085    {
2086      const cmt_string& s = help_texts[i];
2087      if (s == "") break;
2088      cerr << "#   " << s << endl;
2089    }
2090
2091  cerr << "# global options :" << endl;
2092
2093  cerr << "#   -disable_warnings       : don't print warnings" << endl;
2094  cerr << "#   -quiet                  : don't print errors" << endl;
2095  cerr << "#   -use=<p>:<v>:<path>     : set package version path" << endl;
2096  cerr << "#   -pack=<package>         : set package" << endl;
2097  cerr << "#   -version=<version>      : set version" << endl;
2098  cerr << "#   -path=<path>            : set root path" << endl;
2099  cerr << "#   -f=<requirement-file>   : set input file" << endl;
2100  cerr << "#   -e=<statement>          : add a one line statement" << endl;
2101  cerr << "#   -tag=<tag-list>         : select a new tag-set" << endl;
2102  cerr << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
2103  cerr << "#   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
2104  cerr << "#   -warnings               : display various warnings" << endl;
2105  cerr << "#   -with_version_directory : reset to default structuring style" << endl;
2106  cerr << "#   -without_version_directory : switch structuring style" << endl;
2107  cerr << "#   -cleanup                : activate install area cleanup" << endl;
2108  cerr << "#   -no_cleanup             : inhibit install area cleanup" << endl;
2109}
2110
2111void CommandHelp::show (ActionType action)
2112{
2113  //cerr << "CommandHelp::show> action = " << action << endl;
2114
2115  static HelpTexts& help_texts = get_help_texts ();
2116
2117  if (action == action_build)
2118    {
2119      int i;
2120
2121      for (i = action_build_constituent_makefile; i <= action_build_windefs; i++)
2122        {
2123          const cmt_string& s = help_texts[i];
2124          cerr << "#   " << s << endl;
2125        }
2126    }
2127  if (action == action_check)
2128    {
2129      int i;
2130
2131      for (i = action_check_configuration; i <= action_check_version; i++)
2132        {
2133          const cmt_string& s = help_texts[i];
2134          cerr << "#   " << s << endl;
2135        }
2136    }
2137  else if (action == action_show)
2138    {
2139      int i;
2140
2141      for (i = (action_show + 1); i <= action_show_versions; i++)
2142        {
2143          const cmt_string& s = help_texts[i];
2144          cerr << "#   " << s << endl;
2145        }
2146    }
2147  else
2148    {
2149      const cmt_string& s = get_help_text (action);
2150      cerr << "#" << s << endl;
2151    }
2152}
2153
2154CommandHelp& CommandHelp::instance ()
2155{
2156  static CommandHelp me;
2157  return (me);
2158}
2159
2160CommandHelp::CommandHelp ()
2161{
2162  static HelpMap& help = m_help;
2163
2164  static HelpTexts& help_texts = m_help_texts;
2165
2166  help_texts.clear ();
2167
2168  help_texts.add () =  "none";
2169  help_texts.add () =  "awk";
2170  help_texts.add () =  "broadcast [-select=list] [-exclude=list] [-local] [-global] [-begin=pattern] [-depth=n] <command> : apply a command to [some of] the used packages";
2171  help_texts.add () =  "build <option>          : build actions. (Try cmt help build)";
2172  help_texts.add () =  "build constituent_makefile <constituent>  : generate constituent Makefile fragment";
2173  help_texts.add () =  "build constituents_makefile : generate constituents.make";
2174  help_texts.add () =  "build dependencies      : generate dependencies";
2175  help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
2176  help_texts.add () =  "build make_setup        : build a compiled version of setup scripts";
2177  help_texts.add () =  "build msdev             : generate MSDEV files";
2178  help_texts.add () =  "build CMT_pacman        : generate PACMAN manifest file for CMT";
2179  help_texts.add () =  "build vsnet             : generate VS.NET files";
2180  help_texts.add () =  "build os9_makefile      : generate Makefile for OS9";
2181  help_texts.add () =  "build prototype         : generate prototype file";
2182  help_texts.add () =  "build readme            : generate README.html";
2183  help_texts.add () =  "build tag_makefile      : generate tag specific Makefile";
2184  help_texts.add () =  "build temporary_name    : generate a name for a temprary file";
2185  help_texts.add () =  "build triggers <constituent> : generate library trigger file";
2186  help_texts.add () =  "build windefs <library_name> : generate def file for Windows shared libraries";
2187  help_texts.add () =  "check <option>          : check actions. (Try cmt help check)";
2188  help_texts.add () =  "check configuration     : check configuration";
2189  help_texts.add () =  "check files <old> <new> : compare two files and overrides <old> by <new> if different";
2190  help_texts.add () =  "check version <name>    : check if a name follows a version tag syntax ";
2191  help_texts.add () =  "co | checkout           : perform a cvs checkout over a CMT package";
2192  help_texts.add () =  "cleanup [-csh|-sh|-bat] : generate a cleanup script";
2193  help_texts.add () =  "config                  : generate setup and cleanup scripts";
2194  help_texts.add () =  "create <package> <version> [<path>] : create and configure a new package";
2195  help_texts.add () =  "create_project <project> <name> [<path>] : create and configure a new project";
2196  help_texts.add () =  "cvsbranches <module>      : display the subdirectories for a module";
2197  help_texts.add () =  "cvssubpackages <module>   : display the subpackages for a module";
2198  help_texts.add () =  "cvssubprojects <module>   : display the subprojects for a module";
2199  help_texts.add () =  "cvstags <module>          : display the CVS tags for a module";
2200  help_texts.add () =  "do <action> [<param>=<value>] ... : Execute an action";
2201  help_texts.add () =  "expand model <model>    : ";
2202  help_texts.add () =  "filter <in> <out>       : filter a file against CMT macros and env. variables";
2203  help_texts.add () =  "help | -help | --help   : display this help";
2204  help_texts.add () =  "load";
2205  help_texts.add () =  "lock [<p> <v> [<path>]] : lock a package";
2206  help_texts.add () =  "relocate                : generate only setup scripts";
2207  help_texts.add () =  "remove <package> <version> [<path>] : remove a package version";
2208  help_texts.add () =  "remove library_links    : remove symbolic links towards all imported libraries";
2209  help_texts.add () =  "run '<command>'         : apply a command";
2210  help_texts.add () =  "run_sequence <sequence file> : execute a cmt equence file";
2211  help_texts.add () =  "set version <version>   : generate a version file in the current package";
2212  help_texts.add () =  "set versions            : generate version files into packages";
2213  help_texts.add () =  "setup [-csh|-sh|-bat]   : generate a setup script";
2214  help_texts.add () =  "show <option>           : query actions. (Try cmt help show)";
2215  help_texts.add () =  "show  action <name>     :  a formatted action definition";
2216  help_texts.add () =  "show  action_value <name> :  a raw action definition";
2217  help_texts.add () =  "show  action_names      :  all action names";
2218  help_texts.add () =  "show  actions           :  all action definitions";
2219  help_texts.add () =  "show  all_tags          :  all defined tags";
2220  help_texts.add () =  "show  applied_patterns  :  all patterns actually applied";
2221  help_texts.add () =  "show  author            :  package author";
2222  help_texts.add () =  "show  branches          :  added branches";
2223  help_texts.add () =  "show  clients           :  package clients";
2224  help_texts.add () =  "show  cmtpath_patterns  :  cmtpath_patterns";
2225  help_texts.add () =  "show  constituent <name>:  constituent definition";
2226  help_texts.add () =  "show  constituent_names :  constituent names";
2227  help_texts.add () =  "show  constituents      :  constituent definitions";
2228  help_texts.add () =  "show  cycles            :  cycles in the use graph";
2229  help_texts.add () =  "show  fragment <name>   :  one fragment definition";
2230  help_texts.add () =  "show  fragments         :  fragment definitions";
2231  help_texts.add () =  "show  groups            :  group definitions";
2232  help_texts.add () =  "show  include_dirs      :  ";
2233  help_texts.add () =  "show  language <name>   :  language definition";
2234  help_texts.add () =  "show  languages         :  language definitions";
2235  help_texts.add () =  "show  macro <name>      :  a formatted macro definition";
2236  help_texts.add () =  "show  macro_value <name>  :  a raw macro definition";
2237  help_texts.add () =  "show  macro_names       :  all macro names";
2238  help_texts.add () =  "show  macros            :  all macro definitions";
2239  help_texts.add () =  "show  manager           :  package manager";
2240  help_texts.add () =  "show  packages          :  packages reachable from the current context";
2241  help_texts.add () =  "show  path              :  the package search list";
2242  help_texts.add () =  "show  pattern <name>    :  the pattern definition and usages";
2243  help_texts.add () =  "show  pattern_names     :  pattern names";
2244  help_texts.add () =  "show  patterns          :  the pattern definitions";
2245  help_texts.add () =  "show  projects          :  project definitions";
2246  help_texts.add () =  "show  project author    :  project author";
2247  help_texts.add () =  "show  setup             :  setup definitions";
2248  help_texts.add () =  "show  pwd               :  filtered current directory";
2249  help_texts.add () =  "show  set <name>        :  a formatted set definition";
2250  help_texts.add () =  "show  set_names         :  set names";
2251  help_texts.add () =  "show  set_value <name>  :  a raw set definition";
2252  help_texts.add () =  "show  sets              :  set definitions";
2253  help_texts.add () =  "show  strategies        :  all strategies (build & version)";
2254  help_texts.add () =  "show  tags              :  all currently active tags";
2255  help_texts.add () =  "show  use_paths <pack>  :  all paths to the used package";
2256  help_texts.add () =  "show  uses              :  used packages";
2257  help_texts.add () =  "show  version           :  version of the current package";
2258  help_texts.add () =  "show  versions <name>   :  visible versions of the selected package";
2259  help_texts.add () =  "system                  : display the system tag";
2260  help_texts.add () =  "unlock [<p> <v> [<path>]] : unlock a package";
2261  help_texts.add () =  "version                 : version of CMT";
2262  help_texts.add () =  "";
2263
2264  //"build <key>             : build various components :"
2265  //"show <key>              : display various infos on :"
2266
2267  help.add (action_none, help_texts[action_none]);
2268  help.add (action_awk, help_texts[action_awk]);
2269  help.add (action_broadcast, help_texts[action_broadcast]);
2270  help.add (action_build, help_texts[action_build]);
2271  help.add (action_build_constituent_makefile, help_texts[action_build_constituent_makefile]);
2272  help.add (action_build_constituents_makefile, help_texts[action_build_constituents_makefile]);
2273  help.add (action_build_dependencies, help_texts[action_build_dependencies]);
2274  help.add (action_build_library_links, help_texts[action_build_library_links]);
2275  help.add (action_build_make_setup, help_texts[action_build_make_setup]);
2276  help.add (action_build_msdev, help_texts[action_build_msdev]);
2277  help.add (action_build_CMT_pacman, help_texts[action_build_CMT_pacman]);
2278  help.add (action_build_vsnet, help_texts[action_build_vsnet]);
2279  help.add (action_build_os9_makefile, help_texts[action_build_os9_makefile]);
2280  help.add (action_build_prototype, help_texts[action_build_prototype]);
2281  help.add (action_build_readme, help_texts[action_build_readme]);
2282  help.add (action_build_tag_makefile, help_texts[action_build_tag_makefile]);
2283  help.add (action_build_temporary_name, help_texts[action_build_temporary_name]);
2284  help.add (action_build_triggers, help_texts[action_build_triggers]);
2285  help.add (action_build_windefs, help_texts[action_build_windefs]);
2286  help.add (action_check_configuration, help_texts[action_check_configuration]);
2287  help.add (action_check_files, help_texts[action_check_files]);
2288  help.add (action_check_version, help_texts[action_check_version]);
2289  help.add (action_checkout, help_texts[action_checkout]);
2290  help.add (action_cleanup, help_texts[action_cleanup]);
2291  help.add (action_config, help_texts[action_config]);
2292  help.add (action_create, help_texts[action_create]);
2293  help.add (action_create_project, help_texts[action_create_project]);
2294  help.add (action_cvsbranches, help_texts[action_cvsbranches]);
2295  help.add (action_cvssubpackages, help_texts[action_cvssubpackages]);
2296  help.add (action_cvssubprojects, help_texts[action_cvssubprojects]);
2297  help.add (action_cvstags, help_texts[action_cvstags]);
2298  help.add (action_do, help_texts[action_do]);
2299  help.add (action_expand_model, help_texts[action_expand_model]);
2300  help.add (action_filter, help_texts[action_filter]);
2301  help.add (action_help, help_texts[action_help]);
2302  help.add (action_load, help_texts[action_load]);
2303  help.add (action_lock, help_texts[action_lock]);
2304  help.add (action_relocate, help_texts[action_relocate]);
2305  help.add (action_remove, help_texts[action_remove]);
2306  help.add (action_remove_library_links, help_texts[action_remove_library_links]);
2307  help.add (action_run, help_texts[action_run]);
2308  help.add (action_run_sequence, help_texts[action_run_sequence]);
2309  help.add (action_set_version, help_texts[action_set_version]);
2310  help.add (action_set_versions, help_texts[action_set_versions]);
2311  help.add (action_setup, help_texts[action_setup]);
2312  help.add (action_show, help_texts[action_show]);
2313  help.add (action_show_action, help_texts[action_show_action]);
2314  help.add (action_show_action_value, help_texts[action_show_action_value]);
2315  help.add (action_show_action_names, help_texts[action_show_action_names]);
2316  help.add (action_show_actions, help_texts[action_show_actions]);
2317  help.add (action_show_all_tags, help_texts[action_show_all_tags]);
2318  help.add (action_show_applied_patterns, help_texts[action_show_applied_patterns]);
2319  help.add (action_show_author, help_texts[action_show_author]);
2320  help.add (action_show_branches, help_texts[action_show_branches]);
2321  help.add (action_show_clients, help_texts[action_show_clients]);
2322  help.add (action_show_cmtpath_patterns, help_texts[action_show_cmtpath_patterns]);
2323  help.add (action_show_constituent, help_texts[action_show_constituent]);
2324  help.add (action_show_constituent_names, help_texts[action_show_constituent_names]);
2325  help.add (action_show_constituents, help_texts[action_show_constituents]);
2326  help.add (action_show_cycles, help_texts[action_show_cycles]);
2327  help.add (action_show_fragment, help_texts[action_show_fragment]);
2328  help.add (action_show_fragments, help_texts[action_show_fragments]);
2329  help.add (action_show_groups, help_texts[action_show_groups]);
2330  help.add (action_show_include_dirs, help_texts[action_show_include_dirs]);
2331  help.add (action_show_language, help_texts[action_show_language]);
2332  help.add (action_show_languages, help_texts[action_show_languages]);
2333  help.add (action_show_macro, help_texts[action_show_macro]);
2334  help.add (action_show_macro_value, help_texts[action_show_macro_value]);
2335  help.add (action_show_macro_names, help_texts[action_show_macro_names]);
2336  help.add (action_show_macros, help_texts[action_show_macros]);
2337  help.add (action_show_manager, help_texts[action_show_manager]);
2338  help.add (action_show_packages, help_texts[action_show_packages]);
2339  help.add (action_show_path, help_texts[action_show_path]);
2340  help.add (action_show_pattern, help_texts[action_show_pattern]);
2341  help.add (action_show_pattern_names, help_texts[action_show_pattern_names]);
2342  help.add (action_show_patterns, help_texts[action_show_patterns]);
2343  help.add (action_show_projects, help_texts[action_show_projects]);
2344  help.add (action_show_project_author, help_texts[action_show_project_author]);
2345  help.add (action_show_setup, help_texts[action_show_setup]);
2346  help.add (action_show_pwd, help_texts[action_show_pwd]);
2347  help.add (action_show_set, help_texts[action_show_set]);
2348  help.add (action_show_set_names, help_texts[action_show_set_names]);
2349  help.add (action_show_set_value, help_texts[action_show_set_value]);
2350  help.add (action_show_sets, help_texts[action_show_sets]);
2351  help.add (action_show_strategies, help_texts[action_show_strategies]);
2352  help.add (action_show_tags, help_texts[action_show_tags]);
2353  help.add (action_show_use_paths, help_texts[action_show_use_paths]);
2354  help.add (action_show_uses, help_texts[action_show_uses]);
2355  help.add (action_show_version, help_texts[action_show_version]);
2356  help.add (action_show_versions, help_texts[action_show_versions]);
2357  help.add (action_system, help_texts[action_system]);
2358  help.add (action_unlock, help_texts[action_unlock]);
2359  help.add (action_version, help_texts[action_version]);
2360}
2361
Note: See TracBrowser for help on using the repository browser.