source: CMT/v1r21/source/cmt_commands.cxx

Last change on this file was 541, checked in by rybkin, 14 years ago

See C.L. 428

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