source: CMT/v1r20p20081118/source/cmt_commands.cxx @ 615

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

See C.L. 367

  • Property svn:eol-style set to native
File size: 62.6 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              fill_arguments ();
700              cmt.m_action = action_build_windefs;
701            }
702          else
703            {
704              CmtMessage::error ("syntax: arguments missing");
705              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : arguments missing" << endl;
706              help_action = action_help;
707              cmt.m_action = action_build_windefs;
708            }
709        }
710      else
711        {
712          CmtMessage::error ("syntax: wrong build argument");
713          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : wrong build argument" << endl;
714          help_action = action_help;
715          cmt.m_action = action_build;
716        }
717    }
718  else
719    {
720      CmtMessage::error ("syntax: don't know what to build");
721      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to build" << endl;
722      help_action = action_help;
723      cmt.m_action = action_build;
724    }
725}
726
727void ArgParser::do_check ()
728{
729  if (argc > 0)
730    {
731      arg = argv[0];
732
733      shift ();
734
735      if (arg == "configuration")
736        {
737          cmt.m_action = action_check_configuration;
738          //cmt.m_warnings = true;
739        }
740      else if (arg == "files")
741        {
742          if (argc > 0)
743            {
744              fill_one_argument ();
745              if (argc > 0)
746                {
747                  fill_one_argument ();
748                  cmt.m_action = action_check_files;
749                }
750              else
751                {
752                  CmtMessage::error ("syntax: reference file name missing");
753                  //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : reference file name missing" << endl;
754                  help_action = action_help;
755                  cmt.m_action = action_check_files;
756                }
757            }
758          else
759            {
760              CmtMessage::error ("syntax: file name missing");
761              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : file name missing" << endl;
762              help_action = action_help;
763              cmt.m_action = action_check_files;
764            }
765        }
766      else if (arg == "version")
767        {
768          if (argc > 0)
769            {
770              fill_one_argument ();
771              cmt.m_action = action_check_version;
772            }
773          else
774            {
775              CmtMessage::error ("syntax: package name missing");
776              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : package name missing" << endl;
777              help_action = action_help;
778              cmt.m_action = action_check_version;
779            }
780        }
781      else
782        {
783          CmtMessage::error ("syntax: bad check option");
784          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad check option" << endl;
785          help_action = action_help;
786          cmt.m_action = action_check;
787        }
788    }
789  else
790    {
791      CmtMessage::error ("syntax: don't know what to check");
792      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to check" << endl;
793      help_action = action_help;
794      cmt.m_action = action_check;
795    }
796}
797
798void ArgParser::do_check_files ()
799{
800  if (argc > 0)
801    {
802      fill_one_argument ();
803      if (argc > 0)
804        {
805          fill_one_argument ();
806          cmt.m_action = action_check_files;
807        }
808      else
809        {
810          CmtMessage::error ("syntax: reference file name missing");
811          help_action = action_help;
812          cmt.m_action = action_check_files;
813        }
814    }
815  else
816    {
817      CmtMessage::error ("syntax: file name missing");
818      help_action = action_help;
819      cmt.m_action = action_check_files;
820    }
821}
822
823void ArgParser::do_checkout ()
824{
825  if (argc > 0)
826    {
827      fill_arguments ();
828      cmt.m_action = action_checkout;
829    }
830  else
831    {
832      CmtMessage::error ("syntax: checkout arguments missing");
833      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : checkout arguments missing" << endl;
834      help_action = action_help;
835      cmt.m_action = action_checkout;
836    }
837}
838
839void ArgParser::do_cleanup ()
840{
841  cmt.m_action = action_cleanup;
842}
843
844void ArgParser::do_config ()
845{
846  cmt.m_action = action_config;
847}
848
849void ArgParser::do_create ()
850{
851  if (argc > 0)
852    {
853      fill_arguments ();
854      cmt.m_action = action_create;
855    }
856  else
857    {
858      CmtMessage::error ("syntax: create arguments missing");
859      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : create arguments missing" << endl;
860      help_action = action_help;
861      cmt.m_action = action_create;
862    }
863}
864
865void ArgParser::do_create_project ()
866{
867  if (argc > 0)
868    {
869      fill_arguments ();
870      cmt.m_action = action_create_project;
871    }
872  else
873    {
874      CmtMessage::error ("syntax: create_project arguments missing");
875      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : create_project arguments missing" << endl;
876      help_action = action_help;
877      cmt.m_action = action_create_project;
878    }
879}
880
881void ArgParser::do_cvsbranches ()
882{
883  if (argc > 0)
884    {
885      fill_one_argument ();
886      cmt.m_action = action_cvsbranches;
887    }
888  else
889    {
890      CmtMessage::error ("syntax: cvsbranches arguments missing");
891      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : cvsbranches arguments missing" << endl;
892      help_action = action_help;
893      cmt.m_action = action_cvsbranches;
894    }
895}
896
897void ArgParser::do_cvssubpackages ()
898{
899  if (argc > 0)
900    {
901      fill_one_argument ();
902    }
903
904  cmt.m_action = action_cvssubpackages;
905}
906
907void ArgParser::do_cvssubprojects ()
908{
909  if (argc > 0)
910    {
911      fill_one_argument ();
912    }
913
914  cmt.m_action = action_cvssubprojects;
915}
916
917void ArgParser::do_cvstags ()
918{
919  if (argc > 0)
920    {
921      fill_arguments ();
922      cmt.m_action = action_cvstags;
923    }
924  else
925    {
926      CmtMessage::error ("syntax: package name missing");
927      help_action = action_help;
928      cmt.m_action = action_cvstags;
929    }
930}
931
932void ArgParser::do_do ()
933{
934  if (argc > 0)
935    {
936      fill_arguments ();
937                 
938      {
939        cmt_string tag_name = "target_";
940        tag_name += arguments[0];
941
942        Tag* tag;
943        tag = Tag::add (tag_name, PriorityUserTag, "action", 0);                     
944        tag->mark ();
945      }
946
947      cmt.m_action = action_do;
948    }
949  else
950    {
951      CmtMessage::error ("syntax: action not specified");
952      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : action not specified" << endl;
953      help_action = action_help;
954      cmt.m_action = action_do;
955    }
956}
957
958void ArgParser::do_expand ()
959{
960  if (argc > 0)
961    {
962      arg = argv[0];
963
964      shift ();
965      if (arg == "model")
966        {
967          if (argc > 0)
968            {
969              fill_arguments ();
970              cmt.m_action = action_expand_model;
971            }
972          else
973            {
974              CmtMessage::error ("syntax: model not specified");
975              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : model not specified" << endl;
976              help_action = action_help;
977              cmt.m_action = action_expand_model;
978            }
979        }
980      else
981        {
982          CmtMessage::error ("syntax: bad expand option");
983          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad expand option" << endl;
984          help_action = action_help;
985          cmt.m_action = action_expand_model;
986        }
987    }
988  else
989    {
990      CmtMessage::error ("syntax: don't know what to expand");
991      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to expand" << endl;
992      help_action = action_help;
993      cmt.m_action = action_expand_model;
994    }
995}
996
997void ArgParser::do_filter ()
998{
999  if (argc > 0)
1000    {
1001      fill_arguments ();
1002      cmt.m_action = action_filter;
1003    }
1004  else
1005    {
1006      CmtMessage::error ("syntax: file to filter not specified");
1007      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : file to filter not specified" << endl;
1008      help_action = action_help;
1009      cmt.m_action = action_filter;
1010    }
1011}
1012
1013void ArgParser::do_help ()
1014{
1015  help_action = action_help;
1016}
1017
1018void ArgParser::do_lock ()
1019{
1020  if (argc > 0)
1021    {
1022      cmt.m_current_package = fill_one_argument ();
1023      cmt.m_current_version.erase (0);
1024      cmt.m_current_path.erase (0);
1025
1026      if (argc > 0)
1027        {
1028          cmt.m_current_version = fill_one_argument ();
1029          cmt.m_action = action_lock;
1030
1031          if (argc > 0)
1032            {
1033              cmt.m_current_path = fill_one_argument_filtered ();
1034            }
1035
1036          cmt.m_current_access = UserMode;
1037          (Use::current()).set (cmt.m_current_package, 
1038                                cmt.m_current_version, 
1039                                cmt.m_current_path);
1040
1041        }
1042      else
1043        {
1044          CmtMessage::error ("syntax: version missing");
1045          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : version missing" << endl;
1046          help_action = action_help;
1047          cmt.m_action = action_lock;
1048        }
1049    }
1050  else
1051    {
1052      cmt.m_action = action_lock;
1053    }
1054}
1055
1056
1057void ArgParser::do_relocate ()
1058{
1059  cmt.m_action = action_relocate;
1060}
1061
1062
1063void ArgParser::do_remove ()
1064{
1065  if (argc > 0)
1066    {
1067      arg = argv[0];
1068
1069      if (arg == "library_links")
1070        {
1071          shift ();
1072          cmt.m_action = action_remove_library_links;
1073        }
1074      else
1075        {
1076          cmt.m_current_package = fill_one_argument ();
1077          cmt.m_current_version.erase (0);
1078          cmt.m_current_path.erase (0);
1079                     
1080          if (argc > 0)
1081            {
1082              cmt.m_current_version = fill_one_argument ();
1083
1084              if (argc > 0)
1085                {
1086                  cmt.m_current_path = fill_one_argument_filtered ();
1087                }
1088                           
1089              cmt.m_action = action_remove;
1090            }
1091          else
1092            {
1093              CmtMessage::error ("syntax: version missing");
1094              help_action = action_help;
1095              cmt.m_action = action_remove;
1096            }
1097        }
1098    }
1099  else
1100    {
1101      CmtMessage::error ("syntax: don't know what to remove");
1102      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to remove" << endl;
1103      help_action = action_help;
1104      cmt.m_action = action_remove;
1105    }
1106}
1107
1108void ArgParser::do_run ()
1109{
1110  if (argc > 0)
1111    {
1112      fill_arguments ();
1113      cmt.m_action = action_run;
1114    }
1115  else
1116    {
1117      CmtMessage::error ("syntax: run arguments missing");
1118      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : run arguments missing" << endl;
1119      help_action = action_help;
1120      cmt.m_action = action_run;
1121    }
1122}
1123
1124void ArgParser::do_run_sequence ()
1125{
1126  if (argc > 0)
1127    {
1128      fill_one_argument ();
1129      cmt.m_action = action_run_sequence;
1130    }
1131  else
1132    {
1133      CmtMessage::error ("syntax: run_sequence arguments missing");
1134      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : run_sequence arguments missing" << endl;
1135      help_action = action_help;
1136      cmt.m_action = action_run_sequence;
1137    }
1138}
1139
1140void ArgParser::do_set ()
1141{
1142  if (argc > 0)
1143    {
1144      arg = argv[0];
1145
1146      shift ();
1147
1148      if (arg == "version")
1149        {
1150          fill_arguments ();
1151          cmt.m_action = action_set_version;
1152        }
1153      else if (arg == "versions")
1154        {
1155          fill_arguments ();
1156
1157          cmt.m_action = action_set_versions;
1158
1159          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1160            {
1161              cmt.m_scope_filtering_mode = reach_private_uses;
1162            }
1163        }
1164      else
1165        {
1166          CmtMessage::error ("syntax: bad set argument");
1167          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad set argument" << endl;
1168          help_action = action_help;
1169          //cmt.m_action = action_set;
1170        }
1171    }
1172  else
1173    {
1174      CmtMessage::error ("syntax: don't know what to set");
1175      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to set" << endl;
1176      help_action = action_help;
1177      //cmt.m_action = action_set;
1178    }
1179}
1180
1181void ArgParser::do_setup ()
1182{
1183  cmt.m_action = action_setup;
1184  //cmt.m_warnings = true;
1185}
1186
1187void ArgParser::do_show ()
1188{
1189  if (argc > 0)
1190    {
1191      arg = argv[0];
1192
1193      //cerr << "Running show arg=" << arg << endl;
1194
1195      shift ();
1196
1197      if (arg == "action")
1198        {
1199          if (argc > 0)
1200            {
1201              cmt.m_current_target = fill_one_argument ();
1202              cmt.m_action = action_show_action;
1203            }
1204          else
1205            {
1206              CmtMessage::error ("syntax: action name missing");
1207              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : action name missing" << endl;
1208              help_action = action_help;
1209              cmt.m_action = action_show_action;
1210            }
1211        }
1212      else if (arg == "action_names")
1213        {
1214          if (argc > 0)
1215            {
1216              fill_one_argument ();
1217            }
1218
1219          cmt.m_action = action_show_action_names;
1220        }
1221      else if (arg == "action_value")
1222        {
1223          cmt.m_quiet = true;
1224          if (argc > 0)
1225            {
1226              cmt.m_current_target = fill_one_argument ();
1227              cmt.m_action = action_show_action_value;
1228            }
1229          else
1230            {
1231              CmtMessage::error ("syntax: action name missing");
1232              help_action = action_help;
1233              cmt.m_action = action_show_action_value;
1234            }
1235        }
1236      else if (arg == "actions")
1237        {
1238          if (argc > 0)
1239            {
1240              fill_one_argument ();
1241            }
1242
1243          cmt.m_action = action_show_actions;
1244        }
1245      else if (arg == "all_tags")
1246        {
1247          cmt.m_action = action_show_all_tags;
1248        }
1249      else if (arg == "applied_patterns")
1250        {
1251          cmt.m_action = action_show_applied_patterns;
1252        }
1253      else if (arg == "author")
1254        {
1255          cmt.m_action = action_show_author;
1256        }
1257      else if (arg == "branches")
1258        {
1259          cmt.m_action = action_show_branches;
1260        }
1261      else if (arg == "clients")
1262        {
1263          if (argc > 0)
1264            {
1265              cmt.m_current_target = fill_one_argument ();
1266
1267              cmt.m_action = action_show_clients;
1268
1269              if (argc > 0)
1270                {
1271                  fill_one_argument ();
1272                  if (argc > 0)
1273                    {
1274                      fill_one_argument ();
1275                    }
1276                }
1277            }
1278          else
1279            {
1280              CmtMessage::error ("syntax: package name missing");
1281              help_action = action_help;
1282              cmt.m_action = action_show_clients;
1283            }
1284        }
1285      else if (arg == "cmtpath_patterns")
1286        {
1287          cmt.m_action = action_show_cmtpath_patterns;
1288        }
1289      else if (arg == "constituent")
1290        {
1291          if (argc > 0)
1292            {
1293              cmt.m_current_target = fill_one_argument ();
1294              cmt.m_action = action_show_constituent;
1295            }
1296          else
1297            {
1298              CmtMessage::error ("syntax: constituent name missing");
1299              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : constituent name missing" << endl;
1300              help_action = action_help;
1301              cmt.m_action = action_show_constituent;
1302            }
1303        }
1304      else if (arg == "constituent_names")
1305        {
1306          cmt.m_action = action_show_constituent_names;
1307        }
1308      else if (arg == "constituents")
1309        {
1310          cmt.m_action = action_show_constituents;
1311        }
1312      else if (arg == "cycles")
1313        {
1314          cmt.m_action = action_show_cycles;
1315        }
1316      else if (arg == "fragment")
1317        {
1318          if (argc > 0)
1319            {
1320              cmt.m_current_target = fill_one_argument ();
1321              cmt.m_action = action_show_fragment;
1322            }
1323          else
1324            {
1325              CmtMessage::error ("syntax: fragment name missing");
1326              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : fragment name missing" << endl;
1327              help_action = action_help;
1328              cmt.m_action = action_show_fragment;
1329            }
1330        }
1331      else if (arg == "fragments")
1332        {
1333          cmt.m_action = action_show_fragments;
1334        }
1335      else if (arg == "groups")
1336        {
1337          cmt.m_action = action_show_groups;
1338        }
1339      else if (arg == "include_dirs")
1340        {
1341          cmt.m_action = action_show_include_dirs;
1342        }
1343      else if (arg == "language")
1344        {
1345          if (argc > 0)
1346            {
1347              cmt.m_current_target = fill_one_argument ();
1348              cmt.m_action = action_show_language;
1349            }
1350          else
1351            {
1352              CmtMessage::error ("syntax: language name missing");
1353              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : language name missing" << endl;
1354              help_action = action_help;
1355              cmt.m_action = action_show_language;
1356            }
1357        }
1358      else if (arg == "languages")
1359        {
1360          cmt.m_action = action_show_languages;
1361        }
1362      else if (arg == "macro")
1363        {
1364          if (argc > 0)
1365            {
1366              cmt.m_current_target = fill_one_argument ();
1367              cmt.m_action = action_show_macro;
1368            }
1369          else
1370            {
1371              CmtMessage::error ("syntax: macro name missing");
1372              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : macro name missing" << endl;
1373              help_action = action_help;
1374              cmt.m_action = action_show_macro;
1375            }
1376        }
1377      else if (arg == "macro_names")
1378        {
1379          if (argc > 0)
1380            {
1381              fill_one_argument ();
1382            }
1383
1384          cmt.m_action = action_show_macro_names;
1385        }
1386      else if (arg == "macro_value")
1387        {
1388          cmt.m_quiet = true;
1389          if (argc > 0)
1390            {
1391              cmt.m_current_target = fill_one_argument ();
1392              cmt.m_action = action_show_macro_value;
1393            }
1394          else
1395            {
1396              CmtMessage::error ("syntax: macro name missing");
1397              help_action = action_help;
1398              cmt.m_action = action_show_macro_value;
1399            }
1400        }
1401      else if (arg == "macros")
1402        {
1403          if (argc > 0)
1404            {
1405              fill_one_argument ();
1406            }
1407
1408          cmt.m_action = action_show_macros;
1409        }
1410      else if (arg == "manager")
1411        {
1412          cmt.m_action = action_show_manager;
1413        }
1414      else if (arg == "packages")
1415        {
1416          if (argc > 0)
1417            {
1418              cmt.m_current_target = fill_one_argument ();
1419            }
1420
1421          cmt.m_action = action_show_packages;
1422        }
1423      else if (arg == "path")
1424        {
1425          cmt.m_action = action_show_path;
1426        }
1427      else if (arg == "pattern")
1428        {
1429          if (argc > 0)
1430            {
1431              cmt.m_current_target = fill_one_argument ();
1432              cmt.m_action = action_show_pattern;
1433            }
1434          else
1435            {
1436              CmtMessage::error ("syntax: pattern name missing");
1437              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : pattern name missing" << endl;
1438              help_action = action_help;
1439              cmt.m_action = action_show_pattern;
1440            }
1441        }
1442      else if (arg == "pattern_names")
1443        {
1444          cmt.m_action = action_show_pattern_names;
1445        }
1446      else if (arg == "patterns")
1447        {
1448          cmt.m_action = action_show_patterns;
1449        }
1450      else if (arg == "projects")
1451        {
1452          cmt.m_action = action_show_projects;
1453        }
1454        else if (arg == "project_author")
1455        {
1456          cmt.m_action = action_show_project_author;
1457        }
1458
1459      else if (arg == "pwd")
1460        {
1461          cmt.m_action = action_show_pwd;
1462        }
1463      else if (arg == "setup")
1464        {
1465          cmt.m_action = action_show_setup;
1466
1467          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1468            {
1469              cmt.m_scope_filtering_mode = reach_private_uses;
1470            }
1471        }
1472      else if (arg == "set_names")
1473        {
1474          if (argc > 0)
1475            {
1476              fill_one_argument ();
1477            }
1478
1479          cmt.m_action = action_show_set_names;
1480        }
1481      else if (arg == "set_value")
1482        {
1483          cmt.m_quiet = true;
1484          if (argc > 0)
1485            {
1486              cmt.m_current_target = fill_one_argument ();
1487              cmt.m_action = action_show_set_value;
1488            }
1489          else
1490            {
1491              CmtMessage::error ("syntax: set name missing");
1492              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : set name missing" << endl;
1493              help_action = action_help;
1494              cmt.m_action = action_show_set_value;
1495            }
1496        }
1497      else if (arg == "set")
1498        {
1499          if (argc > 0)
1500            {
1501              cmt.m_current_target = fill_one_argument ();
1502              cmt.m_action = action_show_set;
1503            }
1504          else
1505            {
1506              CmtMessage::error ("syntax: set name missing");
1507              help_action = action_help;
1508              cmt.m_action = action_show_set;
1509            }
1510        }
1511      else if (arg == "sets")
1512        {
1513          if (argc > 0)
1514            {
1515              fill_one_argument ();
1516            }
1517
1518          cmt.m_action = action_show_sets;
1519        }
1520      else if (arg == "strategies")
1521        {
1522          cmt.m_action = action_show_strategies;
1523        }
1524      else if (arg == "tags")
1525        {
1526          cmt.m_action = action_show_tags;
1527        }
1528      else if (arg == "use_paths")
1529        {
1530          if (argc > 0)
1531            {
1532              while (argc > 0)
1533                {
1534                  if (strcmp (argv[0], "-private") == 0)
1535                    {
1536                      cmt.m_scope_filtering_mode = reach_private_uses;
1537                    }
1538                  else if (strcmp (argv[0], "--private") == 0)
1539                    {
1540                      cmt.m_scope_filtering_mode = reach_private_uses;
1541                    }
1542                  else
1543                    {
1544                      cmt_string& s = arguments.add ();
1545                      s = argv[0];
1546                    }
1547
1548                  shift ();
1549                }
1550
1551              cmt.m_action = action_show_use_paths;
1552            }
1553          else
1554            {
1555              CmtMessage::error ("syntax: package name missing");
1556              help_action = action_help;
1557              cmt.m_action = action_show_use_paths;
1558            }
1559        }
1560      else if ((arg == "u") ||
1561               (arg == "us") ||
1562               (arg == "use") ||
1563               (arg == "uses"))
1564        {
1565          cmt.m_action = action_show_uses;
1566
1567          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1568            {
1569              cmt.m_scope_filtering_mode = reach_private_uses;
1570            }
1571        }
1572      else if (arg == "version")
1573        {
1574          cmt.m_action = action_show_version;
1575        }
1576      else if (arg == "versions")
1577        {
1578          if (argc > 0)
1579            {
1580              cmt.m_current_target = fill_one_argument ();
1581              cmt.m_action = action_show_versions;
1582            }
1583          else
1584            {
1585              CmtMessage::error ("syntax: package name missing");
1586              help_action = action_help;
1587              cmt.m_action = action_show_versions;
1588            }
1589        }
1590      else
1591        {
1592          CmtMessage::error ("syntax: bad show argument");
1593          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad show argument" << endl;
1594          help_action = action_help;
1595          cmt.m_action = action_show;
1596        }
1597    }
1598  else
1599    {
1600      CmtMessage::error ("syntax: don't know what to show");
1601      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to show" << endl;
1602      help_action = action_help;
1603      cmt.m_action = action_show;
1604    }
1605}
1606
1607void ArgParser::do_system ()
1608{
1609  cmt.m_action = action_system;
1610}
1611
1612void ArgParser::do_unlock ()
1613{
1614  if (argc > 0)
1615    {
1616      cmt.m_current_package = fill_one_argument ();
1617      cmt.m_current_version.erase (0);
1618      cmt.m_current_path.erase (0);
1619                                       
1620      if (argc > 0)
1621        {
1622          cmt.m_current_version = fill_one_argument ();
1623          cmt.m_action = action_unlock;
1624
1625          if (argc > 0)
1626            {
1627              cmt.m_current_path = fill_one_argument_filtered ();
1628            }
1629                                               
1630          cmt.m_current_access = UserMode;
1631          (Use::current()).set (cmt.m_current_package, 
1632                                cmt.m_current_version, 
1633                                cmt.m_current_path);
1634
1635        }
1636      else
1637        {
1638          CmtMessage::error ("syntax: version missing");
1639          help_action = action_help;
1640          cmt.m_action = action_unlock;
1641        }
1642    }
1643  else
1644    {
1645      cmt.m_action = action_unlock;
1646    }
1647}
1648
1649void ArgParser::do_version ()
1650{
1651  cmt.m_action = action_version;
1652}
1653
1654void ArgParser::option_help ()
1655{
1656  help_action = action_help;
1657}
1658
1659void ArgParser::option_n ()
1660{
1661  cmt.m_simulation = true;
1662}
1663
1664
1665void ArgParser::option_disable_warnings ()
1666{
1667  cmt.m_disable_warnings = true;
1668  if (CmtMessage::level () <= Warning)
1669    CmtMessage::set_level (Error);
1670}
1671
1672void ArgParser::option_quiet ()
1673{
1674  cmt.m_quiet = true;
1675  if (CmtMessage::level () <= Error)
1676    CmtMessage::set_level (Fatal);
1677}
1678
1679
1680void ArgParser::option_warnings ()
1681{
1682  cmt.m_warnings = true;
1683  if (CmtMessage::level () != Warning)
1684    CmtMessage::set_level (Warning);
1685}
1686
1687void ArgParser::option_csh ()
1688{
1689  mode = Csh;
1690}
1691
1692void ArgParser::option_sh ()
1693{
1694  mode = Sh;
1695}
1696
1697void ArgParser::option_bat ()
1698{
1699  mode = Bat;
1700}
1701
1702void ArgParser::option_use ()
1703{
1704  if (cmt.m_action != action_create)
1705    {
1706      CmtSystem::cmt_string_vector words;
1707
1708      CmtSystem::split (arg, ":", words);
1709
1710      cmt.m_current_access = UserMode;
1711
1712      if (words.size () > 0) cmt.m_current_package = words[0];
1713      if (words.size () > 1) cmt.m_current_version = words[1];
1714      if (words.size () > 2) cmt.m_current_path    = words[2];
1715      (Use::current()).set (cmt.m_current_package, 
1716                            cmt.m_current_version, 
1717                            cmt.m_current_path);
1718    }
1719}
1720
1721void ArgParser::option_pack ()
1722{
1723  if ((cmt.m_action != action_create) && (cmt.m_current_package != arg))
1724    {
1725      //CmtSystem::cd (cmt.m_default_path);
1726
1727      cmt.m_current_access = UserMode;
1728
1729      cmt.m_current_package = arg;
1730      cmt.m_current_version = "";
1731
1732      /*
1733      cerr << "ArgParser::option_pack> "
1734           << " cp=" << cmt.m_current_package
1735           << " cv=" << cmt.m_current_version
1736           << " cp=" << cmt.m_current_path << endl;
1737      */
1738
1739      (Use::current()).set (cmt.m_current_package, 
1740                            cmt.m_current_version, 
1741                            cmt.m_current_path);
1742    }
1743}
1744
1745void ArgParser::option_version ()
1746{
1747  if ((cmt.m_action != action_create) && (cmt.m_current_version != arg))
1748    {
1749      cmt.m_current_access = UserMode;
1750      cmt.m_current_version = arg;
1751
1752      /*
1753      cerr << "ArgParser::option_version> "
1754           << " cp=" << cmt.m_current_package
1755           << " cv=" << cmt.m_current_version
1756           << " cp=" << cmt.m_current_path << endl;
1757      */
1758
1759      (Use::current()).set (cmt.m_current_package, 
1760                            cmt.m_current_version, 
1761                            cmt.m_current_path);
1762    }
1763}
1764
1765void ArgParser::option_path ()
1766{
1767  if ((cmt.m_action != action_create) && (cmt.m_current_path != arg))
1768    {
1769      cmt.m_current_access = UserMode;
1770      cmt.m_current_path = arg;
1771
1772      /*
1773      cerr << "ArgParser::option_path> "
1774           << " cp=" << cmt.m_current_package
1775           << " cv=" << cmt.m_current_version
1776           << " cp=" << cmt.m_current_path << endl;
1777      */
1778
1779      (Use::current()).set (cmt.m_current_package, 
1780                            cmt.m_current_version, 
1781                            cmt.m_current_path);
1782
1783      //IProjectFactory& factory = ProjectFactory::instance ();
1784      //CmtSystem::add_cmt_path (cmt.m_current_path, "argument", factory);
1785    }
1786}
1787
1788void ArgParser::option_f ()
1789{
1790  extra_file = arg;
1791}
1792
1793void ArgParser::option_e ()
1794{
1795  CmtMessage::warning ("extra statement = " + arg);
1796  //  cerr << "#CMT> Warning: extra statement = " << arg << endl;
1797  extra_line = arg;
1798}
1799
1800void ArgParser::option_home ()
1801{
1802  if (CmtSystem::test_directory (arg))
1803    {
1804      cmt.m_cmt_home = arg;
1805    }
1806}
1807
1808void ArgParser::option_tag ()
1809{
1810  /*
1811    Here we are going to change the complete tag set
1812  */
1813  if (arg != "")
1814    {
1815      Tag* tag;
1816      CmtSystem::cmt_string_vector words;
1817
1818      // First reset selection of all existing tags
1819      //Tag::clear_all ();
1820      Tag::unmark_all ();
1821      cmt.m_extra_tags = ",";
1822                   
1823      // Then restore CMTSITE
1824      Cmt::configure_version_tag ();
1825      Cmt::configure_site_tag (0);
1826      Cmt::configure_uname_tag ();
1827      Cmt::configure_hosttype_tag ();
1828      Cmt::configure_config_tag ();
1829      Cmt::configure_home (0);
1830      Cmt::guess_current_project ();
1831
1832      CmtSystem::split (arg, " \t,", words);
1833                 
1834      for (int i = 0; i < words.size (); i++)
1835        {
1836          const cmt_string& a = words[i];
1837      //if (!cmt.m_quiet) cout  << "parse_argument(tag_add)> current_tag=" << a << endl;                     
1838          cmt_string s = ",";
1839          s += a;
1840          s += ",";
1841                     
1842          if (i == 0)
1843            {
1844              cmt.m_current_tag = a;
1845                         
1846              if (CmtSystem::testenv ("TAGDEBUG")) 
1847              cerr << "parse_argument(tag_add)> current_tag=" << cmt.m_current_tag << endl;
1848            }
1849                     
1850          if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1851            {
1852              //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1853                         
1854              // Then restore uname if the specified tag is CMTCONFIG
1855              if (a == CmtSystem::get_cmt_config ())
1856                {
1857                  Cmt::configure_uname_tag ();
1858                }
1859                         
1860              tag = Tag::add (a, PriorityArgument, "arguments", 0);
1861              tag->mark ();
1862              cmt.m_extra_tags += a;
1863              cmt.m_extra_tags += ",";
1864            }
1865        }
1866        // To be sure that a tag
1867        Cmt::guess_current_project ();
1868    }
1869}
1870
1871void ArgParser::option_tag_add ()
1872{
1873  Tag* tag;
1874  CmtSystem::cmt_string_vector words;
1875 
1876
1877  CmtSystem::split (arg, " \t,", words);
1878
1879  for (int i = 0; i < words.size (); i++)
1880    {
1881      const cmt_string& a = words[i];
1882
1883      cmt_string s = ",";
1884      s += a;
1885      s += ",";
1886
1887      if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1888        {
1889          //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1890
1891          /// Then restore uname if the specified tag is CMTCONFIG
1892          if (a == CmtSystem::get_cmt_config ())
1893            {
1894              Cmt::configure_uname_tag ();
1895            }
1896                     
1897          tag = Tag::add (a, PriorityUserTag, "arguments", 0);
1898                     
1899          tag->mark ();
1900
1901          cmt.m_extra_tags += a;
1902          cmt.m_extra_tags += ",";
1903        }
1904    }
1905}
1906
1907void ArgParser::option_tag_remove ()
1908{
1909  Tag::TagPtrVector tags = Tag::tags ();
1910  int i;
1911  Tag* tag;
1912
1913  /*
1914    for (i = 0; i < tags.size (); i++)
1915    {
1916    tag = tags[i];
1917    if ((tag != 0) &&
1918    (tag->selected))
1919    {
1920    if (!cmt.m_quiet) cerr << "  original tag_list=" << tag->name << tag->priority << endl;
1921    }
1922    }
1923  */
1924
1925  CmtSystem::cmt_string_vector words;
1926
1927  //if (!cmt.m_quiet) cerr << "-arg_remove=" << arg << endl;
1928
1929  CmtSystem::split (arg, " \t,", words);
1930
1931  //
1932  // Now erase all entries in the old list that match
1933  // the specified tags
1934  //
1935
1936  for (i = 0; i < words.size (); i++)
1937    {
1938      const cmt_string& a = words[i];
1939
1940      cmt_string s = ",";
1941      s += a;
1942      s += ",";
1943
1944      int pos;
1945
1946      pos = cmt.m_extra_tags.find (s);
1947
1948      if (pos != cmt_string::npos)
1949        {
1950          cmt.m_extra_tags.erase (pos, s.size () - 1);
1951        }
1952
1953      //if (!cmt.m_quiet) cerr << "  tag_list=[" << tag_list << "]" << endl;
1954    }
1955
1956  //
1957  // Now reinject the purged list of tags into the database
1958  // exactly as when using -tag=<tag-list>
1959  //
1960
1961  /// First forget about all existing tags
1962      Tag::unmark_all ();
1963
1964      /// Then restore CMTSITE
1965        Cmt::configure_version_tag ();
1966        Cmt::configure_site_tag (0);
1967        Cmt::configure_uname_tag ();
1968        Cmt::configure_hosttype_tag ();
1969             
1970        CmtSystem::split (cmt.m_extra_tags, " \t,", words);
1971
1972        for (i = 0; i < words.size (); i++)
1973          {
1974            const cmt_string& a = words[i];
1975
1976            //fprintf (stderr, "  a=[%s]\n", a.c_str ());
1977
1978            /// Then restore uname if the specified tag is CMTCONFIG
1979              if (a == CmtSystem::get_cmt_config ())
1980                {
1981                  Cmt::configure_uname_tag ();
1982                }
1983
1984              if (i == 0)
1985                {
1986                  cmt.m_current_tag = a;
1987
1988                  //if (!cmt.m_quiet) cerr << "parse_argument(tag_remove)> current_tag="
1989                  //<< cmt.m_current_tag << endl;
1990
1991                  tag = Tag::add (a, PriorityTag, "restore configuration", 0);
1992                }
1993              else
1994                {
1995                  tag = Tag::add (a, PriorityUserTag, "restore configuration", 0);
1996                }
1997
1998              tag->mark ();
1999          }
2000}
2001
2002void ArgParser::option_user_context ()
2003{
2004  if (CmtSystem::test_directory (arg))
2005    {
2006      cmt.m_cmt_user_context = arg;
2007    }
2008}
2009
2010void ArgParser::option_with_version_directory ()
2011{
2012  cmt.m_current_structuring_style = with_version_directory;
2013
2014  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2015  if (def != 0)
2016    {
2017      def->m_default_value = true;
2018      def->m_priority_value = false;
2019    }
2020}
2021
2022void ArgParser::option_without_version_directory ()
2023{
2024  cmt.m_current_structuring_style = without_version_directory;
2025
2026  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2027  if (def != 0)
2028    {
2029      def->m_default_value = false;
2030      def->m_priority_value = true;
2031    }
2032}
2033
2034void ArgParser::option_no_cleanup ()
2035{
2036  //cmt.m_current_setup_strategy |= SetupNoCleanup;
2037}
2038
2039void ArgParser::option_private ()
2040{
2041  cmt.m_scope_filtering_mode = reach_private_uses;
2042}
2043
2044void ArgParser::option_public ()
2045{
2046  cmt.m_scope_filtering_mode = block_private_uses;
2047}
2048
2049
2050
2051
2052
2053
2054CommandHelp::HelpMap& CommandHelp::get_help ()
2055{
2056  static CommandHelp& me = instance ();
2057
2058  return (me.m_help);
2059}
2060
2061CommandHelp::HelpTexts& CommandHelp::get_help_texts ()
2062{
2063  static CommandHelp& me = instance ();
2064
2065  return (me.m_help_texts);
2066}
2067
2068const cmt_string& CommandHelp::get_help_text (ActionType key)
2069{
2070  static const HelpTexts& help = get_help_texts ();
2071
2072  const cmt_string& h = help[key];
2073  return (h);
2074}
2075
2076void CommandHelp::show_all ()
2077{
2078  static HelpTexts& help_texts = get_help_texts ();
2079
2080  cerr << "#> cmt command [option...]" << endl;
2081  cerr << "# command :" << endl;
2082
2083  int i;
2084
2085  for (i = 0; ; i++)
2086    {
2087      const cmt_string& s = help_texts[i];
2088      if (s == "") break;
2089      cerr << "#   " << s << endl;
2090    }
2091
2092  cerr << "# global options :" << endl;
2093
2094  cerr << "#   -disable_warnings       : don't print warnings" << endl;
2095  cerr << "#   -quiet                  : don't print errors" << endl;
2096  cerr << "#   -use=<p>:<v>:<path>     : set package version path" << endl;
2097  cerr << "#   -pack=<package>         : set package" << endl;
2098  cerr << "#   -version=<version>      : set version" << endl;
2099  cerr << "#   -path=<path>            : set root path" << endl;
2100  cerr << "#   -f=<requirement-file>   : set input file" << endl;
2101  cerr << "#   -e=<statement>          : add a one line statement" << endl;
2102  cerr << "#   -tag=<tag-list>         : select a new tag-set" << endl;
2103  cerr << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
2104  cerr << "#   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
2105  cerr << "#   -warnings               : display various warnings" << endl;
2106  cerr << "#   -with_version_directory : reset to default structuring style" << endl;
2107  cerr << "#   -without_version_directory : switch structuring style" << endl;
2108  cerr << "#   -cleanup                : activate install area cleanup" << endl;
2109  cerr << "#   -no_cleanup             : inhibit install area cleanup" << endl;
2110}
2111
2112void CommandHelp::show (ActionType action)
2113{
2114  //cerr << "CommandHelp::show> action = " << action << endl;
2115
2116  static HelpTexts& help_texts = get_help_texts ();
2117
2118  if (action == action_build)
2119    {
2120      int i;
2121
2122      for (i = action_build_constituent_makefile; i <= action_build_windefs; i++)
2123        {
2124          const cmt_string& s = help_texts[i];
2125          cerr << "#   " << s << endl;
2126        }
2127    }
2128  if (action == action_check)
2129    {
2130      int i;
2131
2132      for (i = action_check_configuration; i <= action_check_version; i++)
2133        {
2134          const cmt_string& s = help_texts[i];
2135          cerr << "#   " << s << endl;
2136        }
2137    }
2138  else if (action == action_show)
2139    {
2140      int i;
2141
2142      for (i = (action_show + 1); i <= action_show_versions; i++)
2143        {
2144          const cmt_string& s = help_texts[i];
2145          cerr << "#   " << s << endl;
2146        }
2147    }
2148  else
2149    {
2150      const cmt_string& s = get_help_text (action);
2151      cerr << "#" << s << endl;
2152    }
2153}
2154
2155CommandHelp& CommandHelp::instance ()
2156{
2157  static CommandHelp me;
2158  return (me);
2159}
2160
2161CommandHelp::CommandHelp ()
2162{
2163  static HelpMap& help = m_help;
2164
2165  static HelpTexts& help_texts = m_help_texts;
2166
2167  help_texts.clear ();
2168
2169  help_texts.add () =  "none";
2170  help_texts.add () =  "awk";
2171  help_texts.add () =  "broadcast [-select=list] [-exclude=list] [-local] [-global] [-begin=pattern] [-depth=n] <command> : apply a command to [some of] the used packages";
2172  help_texts.add () =  "build <option>          : build actions. (Try cmt help build)";
2173  help_texts.add () =  "build constituent_makefile <constituent>  : generate constituent Makefile fragment";
2174  help_texts.add () =  "build constituents_makefile : generate constituents.make";
2175  help_texts.add () =  "build dependencies      : generate dependencies";
2176  help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
2177  help_texts.add () =  "build make_setup        : build a compiled version of setup scripts";
2178  help_texts.add () =  "build msdev             : generate MSDEV files";
2179  help_texts.add () =  "build CMT_pacman        : generate PACMAN manifest file for CMT";
2180  help_texts.add () =  "build vsnet             : generate VS.NET files";
2181  help_texts.add () =  "build os9_makefile      : generate Makefile for OS9";
2182  help_texts.add () =  "build prototype         : generate prototype file";
2183  help_texts.add () =  "build readme            : generate README.html";
2184  help_texts.add () =  "build tag_makefile      : generate tag specific Makefile";
2185  help_texts.add () =  "build temporary_name    : generate a name for a temprary file";
2186  help_texts.add () =  "build triggers <constituent> : generate library trigger file";
2187  help_texts.add () =  "build windefs [-name=NAME] [@commandfile] (objectfile|library)... : generate def file for Windows shared library [NAME]";
2188  help_texts.add () =  "check <option>          : check actions. (Try cmt help check)";
2189  help_texts.add () =  "check configuration     : check configuration";
2190  help_texts.add () =  "check files <old> <new> : compare two files and overrides <old> by <new> if different";
2191  help_texts.add () =  "check version <name>    : check if a name follows a version tag syntax ";
2192  help_texts.add () =  "co | checkout           : perform a cvs checkout over a CMT package";
2193  help_texts.add () =  "cleanup [-csh|-sh|-bat] : generate a cleanup script";
2194  help_texts.add () =  "config                  : generate setup and cleanup scripts";
2195  help_texts.add () =  "create <package> <version> [<path>] : create and configure a new package";
2196  help_texts.add () =  "create_project <project> <name> [<path>] : create and configure a new project";
2197  help_texts.add () =  "cvsbranches <module>      : display the subdirectories for a module";
2198  help_texts.add () =  "cvssubpackages <module>   : display the subpackages for a module";
2199  help_texts.add () =  "cvssubprojects <module>   : display the subprojects for a module";
2200  help_texts.add () =  "cvstags <module>          : display the CVS tags for a module";
2201  help_texts.add () =  "do <action> [<param>=<value>] ... : Execute an action";
2202  help_texts.add () =  "expand model <model>    : ";
2203  help_texts.add () =  "filter <in> <out>       : filter a file against CMT macros and env. variables";
2204  help_texts.add () =  "help | -help | --help   : display this help";
2205  help_texts.add () =  "load";
2206  help_texts.add () =  "lock [<p> <v> [<path>]] : lock a package";
2207  help_texts.add () =  "relocate                : generate only setup scripts";
2208  help_texts.add () =  "remove <package> <version> [<path>] : remove a package version";
2209  help_texts.add () =  "remove library_links    : remove symbolic links towards all imported libraries";
2210  help_texts.add () =  "run '<command>'         : apply a command";
2211  help_texts.add () =  "run_sequence <sequence file> : execute a cmt equence file";
2212  help_texts.add () =  "set version <version>   : generate a version file in the current package";
2213  help_texts.add () =  "set versions            : generate version files into packages";
2214  help_texts.add () =  "setup [-csh|-sh|-bat]   : generate a setup script";
2215  help_texts.add () =  "show <option>           : query actions. (Try cmt help show)";
2216  help_texts.add () =  "show  action <name>     :  a formatted action definition";
2217  help_texts.add () =  "show  action_value <name> :  a raw action definition";
2218  help_texts.add () =  "show  action_names      :  all action names";
2219  help_texts.add () =  "show  actions           :  all action definitions";
2220  help_texts.add () =  "show  all_tags          :  all defined tags";
2221  help_texts.add () =  "show  applied_patterns  :  all patterns actually applied";
2222  help_texts.add () =  "show  author            :  package author";
2223  help_texts.add () =  "show  branches          :  added branches";
2224  help_texts.add () =  "show  clients           :  package clients";
2225  help_texts.add () =  "show  cmtpath_patterns  :  cmtpath_patterns";
2226  help_texts.add () =  "show  constituent <name>:  constituent definition";
2227  help_texts.add () =  "show  constituent_names :  constituent names";
2228  help_texts.add () =  "show  constituents      :  constituent definitions";
2229  help_texts.add () =  "show  cycles            :  cycles in the use graph";
2230  help_texts.add () =  "show  fragment <name>   :  one fragment definition";
2231  help_texts.add () =  "show  fragments         :  fragment definitions";
2232  help_texts.add () =  "show  groups            :  group definitions";
2233  help_texts.add () =  "show  include_dirs      :  ";
2234  help_texts.add () =  "show  language <name>   :  language definition";
2235  help_texts.add () =  "show  languages         :  language definitions";
2236  help_texts.add () =  "show  macro <name>      :  a formatted macro definition";
2237  help_texts.add () =  "show  macro_value <name>  :  a raw macro definition";
2238  help_texts.add () =  "show  macro_names       :  all macro names";
2239  help_texts.add () =  "show  macros            :  all macro definitions";
2240  help_texts.add () =  "show  manager           :  package manager";
2241  help_texts.add () =  "show  packages          :  packages reachable from the current context";
2242  help_texts.add () =  "show  path              :  the package search list";
2243  help_texts.add () =  "show  pattern <name>    :  the pattern definition and usages";
2244  help_texts.add () =  "show  pattern_names     :  pattern names";
2245  help_texts.add () =  "show  patterns          :  the pattern definitions";
2246  help_texts.add () =  "show  projects          :  project definitions";
2247  help_texts.add () =  "show  project author    :  project author";
2248  help_texts.add () =  "show  setup             :  setup definitions";
2249  help_texts.add () =  "show  pwd               :  filtered current directory";
2250  help_texts.add () =  "show  set <name>        :  a formatted set definition";
2251  help_texts.add () =  "show  set_names         :  set names";
2252  help_texts.add () =  "show  set_value <name>  :  a raw set definition";
2253  help_texts.add () =  "show  sets              :  set definitions";
2254  help_texts.add () =  "show  strategies        :  all strategies (build & version)";
2255  help_texts.add () =  "show  tags              :  all currently active tags";
2256  help_texts.add () =  "show  use_paths <pack>  :  all paths to the used package";
2257  help_texts.add () =  "show  uses              :  used packages";
2258  help_texts.add () =  "show  version           :  version of the current package";
2259  help_texts.add () =  "show  versions <name>   :  visible versions of the selected package";
2260  help_texts.add () =  "system                  : display the system tag";
2261  help_texts.add () =  "unlock [<p> <v> [<path>]] : unlock a package";
2262  help_texts.add () =  "version                 : version of CMT";
2263  help_texts.add () =  "";
2264
2265  //"build <key>             : build various components :"
2266  //"show <key>              : display various infos on :"
2267
2268  help.add (action_none, help_texts[action_none]);
2269  help.add (action_awk, help_texts[action_awk]);
2270  help.add (action_broadcast, help_texts[action_broadcast]);
2271  help.add (action_build, help_texts[action_build]);
2272  help.add (action_build_constituent_makefile, help_texts[action_build_constituent_makefile]);
2273  help.add (action_build_constituents_makefile, help_texts[action_build_constituents_makefile]);
2274  help.add (action_build_dependencies, help_texts[action_build_dependencies]);
2275  help.add (action_build_library_links, help_texts[action_build_library_links]);
2276  help.add (action_build_make_setup, help_texts[action_build_make_setup]);
2277  help.add (action_build_msdev, help_texts[action_build_msdev]);
2278  help.add (action_build_CMT_pacman, help_texts[action_build_CMT_pacman]);
2279  help.add (action_build_vsnet, help_texts[action_build_vsnet]);
2280  help.add (action_build_os9_makefile, help_texts[action_build_os9_makefile]);
2281  help.add (action_build_prototype, help_texts[action_build_prototype]);
2282  help.add (action_build_readme, help_texts[action_build_readme]);
2283  help.add (action_build_tag_makefile, help_texts[action_build_tag_makefile]);
2284  help.add (action_build_temporary_name, help_texts[action_build_temporary_name]);
2285  help.add (action_build_triggers, help_texts[action_build_triggers]);
2286  help.add (action_build_windefs, help_texts[action_build_windefs]);
2287  help.add (action_check_configuration, help_texts[action_check_configuration]);
2288  help.add (action_check_files, help_texts[action_check_files]);
2289  help.add (action_check_version, help_texts[action_check_version]);
2290  help.add (action_checkout, help_texts[action_checkout]);
2291  help.add (action_cleanup, help_texts[action_cleanup]);
2292  help.add (action_config, help_texts[action_config]);
2293  help.add (action_create, help_texts[action_create]);
2294  help.add (action_create_project, help_texts[action_create_project]);
2295  help.add (action_cvsbranches, help_texts[action_cvsbranches]);
2296  help.add (action_cvssubpackages, help_texts[action_cvssubpackages]);
2297  help.add (action_cvssubprojects, help_texts[action_cvssubprojects]);
2298  help.add (action_cvstags, help_texts[action_cvstags]);
2299  help.add (action_do, help_texts[action_do]);
2300  help.add (action_expand_model, help_texts[action_expand_model]);
2301  help.add (action_filter, help_texts[action_filter]);
2302  help.add (action_help, help_texts[action_help]);
2303  help.add (action_load, help_texts[action_load]);
2304  help.add (action_lock, help_texts[action_lock]);
2305  help.add (action_relocate, help_texts[action_relocate]);
2306  help.add (action_remove, help_texts[action_remove]);
2307  help.add (action_remove_library_links, help_texts[action_remove_library_links]);
2308  help.add (action_run, help_texts[action_run]);
2309  help.add (action_run_sequence, help_texts[action_run_sequence]);
2310  help.add (action_set_version, help_texts[action_set_version]);
2311  help.add (action_set_versions, help_texts[action_set_versions]);
2312  help.add (action_setup, help_texts[action_setup]);
2313  help.add (action_show, help_texts[action_show]);
2314  help.add (action_show_action, help_texts[action_show_action]);
2315  help.add (action_show_action_value, help_texts[action_show_action_value]);
2316  help.add (action_show_action_names, help_texts[action_show_action_names]);
2317  help.add (action_show_actions, help_texts[action_show_actions]);
2318  help.add (action_show_all_tags, help_texts[action_show_all_tags]);
2319  help.add (action_show_applied_patterns, help_texts[action_show_applied_patterns]);
2320  help.add (action_show_author, help_texts[action_show_author]);
2321  help.add (action_show_branches, help_texts[action_show_branches]);
2322  help.add (action_show_clients, help_texts[action_show_clients]);
2323  help.add (action_show_cmtpath_patterns, help_texts[action_show_cmtpath_patterns]);
2324  help.add (action_show_constituent, help_texts[action_show_constituent]);
2325  help.add (action_show_constituent_names, help_texts[action_show_constituent_names]);
2326  help.add (action_show_constituents, help_texts[action_show_constituents]);
2327  help.add (action_show_cycles, help_texts[action_show_cycles]);
2328  help.add (action_show_fragment, help_texts[action_show_fragment]);
2329  help.add (action_show_fragments, help_texts[action_show_fragments]);
2330  help.add (action_show_groups, help_texts[action_show_groups]);
2331  help.add (action_show_include_dirs, help_texts[action_show_include_dirs]);
2332  help.add (action_show_language, help_texts[action_show_language]);
2333  help.add (action_show_languages, help_texts[action_show_languages]);
2334  help.add (action_show_macro, help_texts[action_show_macro]);
2335  help.add (action_show_macro_value, help_texts[action_show_macro_value]);
2336  help.add (action_show_macro_names, help_texts[action_show_macro_names]);
2337  help.add (action_show_macros, help_texts[action_show_macros]);
2338  help.add (action_show_manager, help_texts[action_show_manager]);
2339  help.add (action_show_packages, help_texts[action_show_packages]);
2340  help.add (action_show_path, help_texts[action_show_path]);
2341  help.add (action_show_pattern, help_texts[action_show_pattern]);
2342  help.add (action_show_pattern_names, help_texts[action_show_pattern_names]);
2343  help.add (action_show_patterns, help_texts[action_show_patterns]);
2344  help.add (action_show_projects, help_texts[action_show_projects]);
2345  help.add (action_show_project_author, help_texts[action_show_project_author]);
2346  help.add (action_show_setup, help_texts[action_show_setup]);
2347  help.add (action_show_pwd, help_texts[action_show_pwd]);
2348  help.add (action_show_set, help_texts[action_show_set]);
2349  help.add (action_show_set_names, help_texts[action_show_set_names]);
2350  help.add (action_show_set_value, help_texts[action_show_set_value]);
2351  help.add (action_show_sets, help_texts[action_show_sets]);
2352  help.add (action_show_strategies, help_texts[action_show_strategies]);
2353  help.add (action_show_tags, help_texts[action_show_tags]);
2354  help.add (action_show_use_paths, help_texts[action_show_use_paths]);
2355  help.add (action_show_uses, help_texts[action_show_uses]);
2356  help.add (action_show_version, help_texts[action_show_version]);
2357  help.add (action_show_versions, help_texts[action_show_versions]);
2358  help.add (action_system, help_texts[action_system]);
2359  help.add (action_unlock, help_texts[action_unlock]);
2360  help.add (action_version, help_texts[action_version]);
2361}
2362
Note: See TracBrowser for help on using the repository browser.