source: CMT/v1r20p20090520/source/cmt_commands.cxx @ 668

Last change on this file since 668 was 496, checked in by rybkin, 15 years ago

See C.L. 391

  • Property svn:eol-style set to native
File size: 63.0 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 == "cycles")
1315        {
1316          cmt.m_action = action_show_cycles;
1317        }
1318      else if (arg == "fragment")
1319        {
1320          if (argc > 0)
1321            {
1322              cmt.m_current_target = fill_one_argument ();
1323              cmt.m_action = action_show_fragment;
1324            }
1325          else
1326            {
1327              CmtMessage::error ("syntax: fragment name missing");
1328              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : fragment name missing" << endl;
1329              help_action = action_help;
1330              cmt.m_action = action_show_fragment;
1331            }
1332        }
1333      else if (arg == "fragments")
1334        {
1335          cmt.m_action = action_show_fragments;
1336        }
1337      else if (arg == "groups")
1338        {
1339          cmt.m_action = action_show_groups;
1340        }
1341      else if (arg == "include_dirs")
1342        {
1343          cmt.m_action = action_show_include_dirs;
1344        }
1345      else if (arg == "language")
1346        {
1347          if (argc > 0)
1348            {
1349              cmt.m_current_target = fill_one_argument ();
1350              cmt.m_action = action_show_language;
1351            }
1352          else
1353            {
1354              CmtMessage::error ("syntax: language name missing");
1355              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : language name missing" << endl;
1356              help_action = action_help;
1357              cmt.m_action = action_show_language;
1358            }
1359        }
1360      else if (arg == "languages")
1361        {
1362          cmt.m_action = action_show_languages;
1363        }
1364      else if (arg == "macro")
1365        {
1366          if (argc > 0)
1367            {
1368              cmt.m_current_target = fill_one_argument ();
1369              cmt.m_action = action_show_macro;
1370            }
1371          else
1372            {
1373              CmtMessage::error ("syntax: macro name missing");
1374              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : macro name missing" << endl;
1375              help_action = action_help;
1376              cmt.m_action = action_show_macro;
1377            }
1378        }
1379      else if (arg == "macro_names")
1380        {
1381          if (argc > 0)
1382            {
1383              fill_one_argument ();
1384            }
1385
1386          cmt.m_action = action_show_macro_names;
1387        }
1388      else if (arg == "macro_value")
1389        {
1390          cmt.m_quiet = true;
1391          if (argc > 0)
1392            {
1393              cmt.m_current_target = fill_one_argument ();
1394              cmt.m_action = action_show_macro_value;
1395            }
1396          else
1397            {
1398              CmtMessage::error ("syntax: macro name missing");
1399              help_action = action_help;
1400              cmt.m_action = action_show_macro_value;
1401            }
1402        }
1403      else if (arg == "macros")
1404        {
1405          if (argc > 0)
1406            {
1407              fill_one_argument ();
1408            }
1409
1410          cmt.m_action = action_show_macros;
1411        }
1412      else if (arg == "manager")
1413        {
1414          cmt.m_action = action_show_manager;
1415        }
1416      else if (arg == "packages")
1417        {
1418          if (argc > 0)
1419            {
1420              cmt.m_current_target = fill_one_argument ();
1421            }
1422
1423          cmt.m_action = action_show_packages;
1424        }
1425      else if (arg == "path")
1426        {
1427          if (argc == 0)
1428            {
1429              cmt.m_action = action_show_path;
1430            }
1431          else if (argc == 1 && cmt_string (argv[0]) == "-d")
1432            {
1433              fill_one_argument ();
1434              cmt.m_action = action_show_path;
1435            }
1436          else
1437            {
1438              cmt.m_action = action_show_path;
1439              help_action = action_help;
1440            }
1441        }
1442      else if (arg == "pattern")
1443        {
1444          if (argc > 0)
1445            {
1446              cmt.m_current_target = fill_one_argument ();
1447              cmt.m_action = action_show_pattern;
1448            }
1449          else
1450            {
1451              CmtMessage::error ("syntax: pattern name missing");
1452              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : pattern name missing" << endl;
1453              help_action = action_help;
1454              cmt.m_action = action_show_pattern;
1455            }
1456        }
1457      else if (arg == "pattern_names")
1458        {
1459          cmt.m_action = action_show_pattern_names;
1460        }
1461      else if (arg == "patterns")
1462        {
1463          cmt.m_action = action_show_patterns;
1464        }
1465      else if (arg == "projects")
1466        {
1467          cmt.m_action = action_show_projects;
1468        }
1469        else if (arg == "project_author")
1470        {
1471          cmt.m_action = action_show_project_author;
1472        }
1473
1474      else if (arg == "pwd")
1475        {
1476          cmt.m_action = action_show_pwd;
1477        }
1478      else if (arg == "setup")
1479        {
1480          cmt.m_action = action_show_setup;
1481
1482          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1483            {
1484              cmt.m_scope_filtering_mode = reach_private_uses;
1485            }
1486        }
1487      else if (arg == "set_names")
1488        {
1489          if (argc > 0)
1490            {
1491              fill_one_argument ();
1492            }
1493
1494          cmt.m_action = action_show_set_names;
1495        }
1496      else if (arg == "set_value")
1497        {
1498          cmt.m_quiet = true;
1499          if (argc > 0)
1500            {
1501              cmt.m_current_target = fill_one_argument ();
1502              cmt.m_action = action_show_set_value;
1503            }
1504          else
1505            {
1506              CmtMessage::error ("syntax: set name missing");
1507              //              if (!cmt.m_quiet) cerr << "#CMT> syntax error : set name missing" << endl;
1508              help_action = action_help;
1509              cmt.m_action = action_show_set_value;
1510            }
1511        }
1512      else if (arg == "set")
1513        {
1514          if (argc > 0)
1515            {
1516              cmt.m_current_target = fill_one_argument ();
1517              cmt.m_action = action_show_set;
1518            }
1519          else
1520            {
1521              CmtMessage::error ("syntax: set name missing");
1522              help_action = action_help;
1523              cmt.m_action = action_show_set;
1524            }
1525        }
1526      else if (arg == "sets")
1527        {
1528          if (argc > 0)
1529            {
1530              fill_one_argument ();
1531            }
1532
1533          cmt.m_action = action_show_sets;
1534        }
1535      else if (arg == "strategies")
1536        {
1537          cmt.m_action = action_show_strategies;
1538        }
1539      else if (arg == "tags")
1540        {
1541          cmt.m_action = action_show_tags;
1542        }
1543      else if (arg == "use_paths")
1544        {
1545          if (argc > 0)
1546            {
1547              while (argc > 0)
1548                {
1549                  if (strcmp (argv[0], "-private") == 0)
1550                    {
1551                      cmt.m_scope_filtering_mode = reach_private_uses;
1552                    }
1553                  else if (strcmp (argv[0], "--private") == 0)
1554                    {
1555                      cmt.m_scope_filtering_mode = reach_private_uses;
1556                    }
1557                  else
1558                    {
1559                      cmt_string& s = arguments.add ();
1560                      s = argv[0];
1561                    }
1562
1563                  shift ();
1564                }
1565
1566              cmt.m_action = action_show_use_paths;
1567            }
1568          else
1569            {
1570              CmtMessage::error ("syntax: package name missing");
1571              help_action = action_help;
1572              cmt.m_action = action_show_use_paths;
1573            }
1574        }
1575      else if ((arg == "u") ||
1576               (arg == "us") ||
1577               (arg == "use") ||
1578               (arg == "uses"))
1579        {
1580          cmt.m_action = action_show_uses;
1581
1582          if (cmt.m_scope_filtering_mode == default_filtering_mode)
1583            {
1584              cmt.m_scope_filtering_mode = reach_private_uses;
1585            }
1586        }
1587      else if (arg == "version")
1588        {
1589          cmt.m_action = action_show_version;
1590        }
1591      else if (arg == "versions")
1592        {
1593          if (argc > 0)
1594            {
1595              cmt.m_current_target = fill_one_argument ();
1596              cmt.m_action = action_show_versions;
1597            }
1598          else
1599            {
1600              CmtMessage::error ("syntax: package name missing");
1601              help_action = action_help;
1602              cmt.m_action = action_show_versions;
1603            }
1604        }
1605      else
1606        {
1607          CmtMessage::error ("syntax: bad show argument");
1608          //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : bad show argument" << endl;
1609          help_action = action_help;
1610          cmt.m_action = action_show;
1611        }
1612    }
1613  else
1614    {
1615      CmtMessage::error ("syntax: don't know what to show");
1616      //      if (!cmt.m_quiet) cerr << "#CMT> syntax error : don't know what to show" << endl;
1617      help_action = action_help;
1618      cmt.m_action = action_show;
1619    }
1620}
1621
1622void ArgParser::do_system ()
1623{
1624  cmt.m_action = action_system;
1625}
1626
1627void ArgParser::do_unlock ()
1628{
1629  if (argc > 0)
1630    {
1631      cmt.m_current_package = fill_one_argument ();
1632      cmt.m_current_version.erase (0);
1633      cmt.m_current_path.erase (0);
1634                                       
1635      if (argc > 0)
1636        {
1637          cmt.m_current_version = fill_one_argument ();
1638          cmt.m_action = action_unlock;
1639
1640          if (argc > 0)
1641            {
1642              cmt.m_current_path = fill_one_argument_filtered ();
1643            }
1644                                               
1645          cmt.m_current_access = UserMode;
1646          (Use::current()).set (cmt.m_current_package, 
1647                                cmt.m_current_version, 
1648                                cmt.m_current_path);
1649
1650        }
1651      else
1652        {
1653          CmtMessage::error ("syntax: version missing");
1654          help_action = action_help;
1655          cmt.m_action = action_unlock;
1656        }
1657    }
1658  else
1659    {
1660      cmt.m_action = action_unlock;
1661    }
1662}
1663
1664void ArgParser::do_version ()
1665{
1666  cmt.m_action = action_version;
1667}
1668
1669void ArgParser::option_help ()
1670{
1671  help_action = action_help;
1672}
1673
1674void ArgParser::option_n ()
1675{
1676  cmt.m_simulation = true;
1677}
1678
1679
1680void ArgParser::option_disable_warnings ()
1681{
1682  cmt.m_disable_warnings = true;
1683  if (CmtMessage::level () <= Warning)
1684    CmtMessage::set_level (Error);
1685}
1686
1687void ArgParser::option_quiet ()
1688{
1689  cmt.m_quiet = true;
1690  if (CmtMessage::level () <= Error)
1691    CmtMessage::set_level (Fatal);
1692}
1693
1694
1695void ArgParser::option_warnings ()
1696{
1697  cmt.m_warnings = true;
1698  if (CmtMessage::level () != Warning)
1699    CmtMessage::set_level (Warning);
1700}
1701
1702void ArgParser::option_csh ()
1703{
1704  mode = Csh;
1705}
1706
1707void ArgParser::option_sh ()
1708{
1709  mode = Sh;
1710}
1711
1712void ArgParser::option_bat ()
1713{
1714  mode = Bat;
1715}
1716
1717void ArgParser::option_use ()
1718{
1719  if (cmt.m_action != action_create)
1720    {
1721      CmtSystem::cmt_string_vector words;
1722
1723      CmtSystem::split (arg, ":", words);
1724
1725      cmt.m_current_access = UserMode;
1726
1727      if (words.size () > 0) cmt.m_current_package = words[0];
1728      if (words.size () > 1) cmt.m_current_version = words[1];
1729      if (words.size () > 2) cmt.m_current_path    = words[2];
1730      (Use::current()).set (cmt.m_current_package, 
1731                            cmt.m_current_version, 
1732                            cmt.m_current_path);
1733    }
1734}
1735
1736void ArgParser::option_pack ()
1737{
1738  if ((cmt.m_action != action_create) && (cmt.m_current_package != arg))
1739    {
1740      //CmtSystem::cd (cmt.m_default_path);
1741
1742      cmt.m_current_access = UserMode;
1743
1744      cmt.m_current_package = arg;
1745      cmt.m_current_version = "";
1746
1747      /*
1748      cerr << "ArgParser::option_pack> "
1749           << " cp=" << cmt.m_current_package
1750           << " cv=" << cmt.m_current_version
1751           << " cp=" << cmt.m_current_path << endl;
1752      */
1753
1754      (Use::current()).set (cmt.m_current_package, 
1755                            cmt.m_current_version, 
1756                            cmt.m_current_path);
1757    }
1758}
1759
1760void ArgParser::option_version ()
1761{
1762  if ((cmt.m_action != action_create) && (cmt.m_current_version != arg))
1763    {
1764      cmt.m_current_access = UserMode;
1765      cmt.m_current_version = arg;
1766
1767      /*
1768      cerr << "ArgParser::option_version> "
1769           << " cp=" << cmt.m_current_package
1770           << " cv=" << cmt.m_current_version
1771           << " cp=" << cmt.m_current_path << endl;
1772      */
1773
1774      (Use::current()).set (cmt.m_current_package, 
1775                            cmt.m_current_version, 
1776                            cmt.m_current_path);
1777    }
1778}
1779
1780void ArgParser::option_path ()
1781{
1782  if ((cmt.m_action != action_create) && (cmt.m_current_path != arg))
1783    {
1784      cmt.m_current_access = UserMode;
1785      cmt.m_current_path = arg;
1786
1787      /*
1788      cerr << "ArgParser::option_path> "
1789           << " cp=" << cmt.m_current_package
1790           << " cv=" << cmt.m_current_version
1791           << " cp=" << cmt.m_current_path << endl;
1792      */
1793
1794      (Use::current()).set (cmt.m_current_package, 
1795                            cmt.m_current_version, 
1796                            cmt.m_current_path);
1797
1798      //IProjectFactory& factory = ProjectFactory::instance ();
1799      //CmtSystem::add_cmt_path (cmt.m_current_path, "argument", factory);
1800    }
1801}
1802
1803void ArgParser::option_f ()
1804{
1805  extra_file = arg;
1806}
1807
1808void ArgParser::option_e ()
1809{
1810  CmtMessage::warning ("extra statement = " + arg);
1811  //  cerr << "#CMT> Warning: extra statement = " << arg << endl;
1812  extra_line = arg;
1813}
1814
1815void ArgParser::option_home ()
1816{
1817  if (CmtSystem::test_directory (arg))
1818    {
1819      cmt.m_cmt_home = arg;
1820    }
1821}
1822
1823void ArgParser::option_tag ()
1824{
1825  /*
1826    Here we are going to change the complete tag set
1827  */
1828  if (arg != "")
1829    {
1830      Tag* tag;
1831      CmtSystem::cmt_string_vector words;
1832
1833      // First reset selection of all existing tags
1834      //Tag::clear_all ();
1835      Tag::unmark_all ();
1836      cmt.m_extra_tags = ",";
1837                   
1838      // Then restore CMTSITE
1839      Cmt::configure_version_tag ();
1840      Cmt::configure_site_tag (0);
1841      Cmt::configure_uname_tag ();
1842      Cmt::configure_hosttype_tag ();
1843      Cmt::configure_config_tag ();
1844      Cmt::configure_home (0);
1845      Cmt::guess_current_project ();
1846
1847      CmtSystem::split (arg, " \t,", words);
1848                 
1849      for (int i = 0; i < words.size (); i++)
1850        {
1851          const cmt_string& a = words[i];
1852      //if (!cmt.m_quiet) cout  << "parse_argument(tag_add)> current_tag=" << a << endl;                     
1853          cmt_string s = ",";
1854          s += a;
1855          s += ",";
1856                     
1857          if (i == 0)
1858            {
1859              cmt.m_current_tag = a;
1860                         
1861              if (CmtSystem::testenv ("TAGDEBUG")) 
1862              cerr << "parse_argument(tag_add)> current_tag=" << cmt.m_current_tag << endl;
1863            }
1864                     
1865          if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1866            {
1867              //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1868                         
1869              // Then restore uname if the specified tag is CMTCONFIG
1870              if (a == CmtSystem::get_cmt_config ())
1871                {
1872                  Cmt::configure_uname_tag ();
1873                }
1874                         
1875              tag = Tag::add (a, PriorityArgument, "arguments", 0);
1876              tag->mark ();
1877              cmt.m_extra_tags += a;
1878              cmt.m_extra_tags += ",";
1879            }
1880        }
1881        // To be sure that a tag
1882        Cmt::guess_current_project ();
1883    }
1884}
1885
1886void ArgParser::option_tag_add ()
1887{
1888  Tag* tag;
1889  CmtSystem::cmt_string_vector words;
1890 
1891
1892  CmtSystem::split (arg, " \t,", words);
1893
1894  for (int i = 0; i < words.size (); i++)
1895    {
1896      const cmt_string& a = words[i];
1897
1898      cmt_string s = ",";
1899      s += a;
1900      s += ",";
1901
1902      if (cmt.m_extra_tags.find (s) == cmt_string::npos)
1903        {
1904          //if (!cmt.m_quiet) cerr << "  a=[" << a << "]" << endl;
1905
1906          /// Then restore uname if the specified tag is CMTCONFIG
1907          if (a == CmtSystem::get_cmt_config ())
1908            {
1909              Cmt::configure_uname_tag ();
1910            }
1911                     
1912          tag = Tag::add (a, PriorityUserTag, "arguments", 0);
1913                     
1914          tag->mark ();
1915
1916          cmt.m_extra_tags += a;
1917          cmt.m_extra_tags += ",";
1918        }
1919    }
1920}
1921
1922void ArgParser::option_tag_remove ()
1923{
1924  Tag::TagPtrVector tags = Tag::tags ();
1925  int i;
1926  Tag* tag;
1927
1928  /*
1929    for (i = 0; i < tags.size (); i++)
1930    {
1931    tag = tags[i];
1932    if ((tag != 0) &&
1933    (tag->selected))
1934    {
1935    if (!cmt.m_quiet) cerr << "  original tag_list=" << tag->name << tag->priority << endl;
1936    }
1937    }
1938  */
1939
1940  CmtSystem::cmt_string_vector words;
1941
1942  //if (!cmt.m_quiet) cerr << "-arg_remove=" << arg << endl;
1943
1944  CmtSystem::split (arg, " \t,", words);
1945
1946  //
1947  // Now erase all entries in the old list that match
1948  // the specified tags
1949  //
1950
1951  for (i = 0; i < words.size (); i++)
1952    {
1953      const cmt_string& a = words[i];
1954
1955      cmt_string s = ",";
1956      s += a;
1957      s += ",";
1958
1959      int pos;
1960
1961      pos = cmt.m_extra_tags.find (s);
1962
1963      if (pos != cmt_string::npos)
1964        {
1965          cmt.m_extra_tags.erase (pos, s.size () - 1);
1966        }
1967
1968      //if (!cmt.m_quiet) cerr << "  tag_list=[" << tag_list << "]" << endl;
1969    }
1970
1971  //
1972  // Now reinject the purged list of tags into the database
1973  // exactly as when using -tag=<tag-list>
1974  //
1975
1976  /// First forget about all existing tags
1977      Tag::unmark_all ();
1978
1979      /// Then restore CMTSITE
1980        Cmt::configure_version_tag ();
1981        Cmt::configure_site_tag (0);
1982        Cmt::configure_uname_tag ();
1983        Cmt::configure_hosttype_tag ();
1984             
1985        CmtSystem::split (cmt.m_extra_tags, " \t,", words);
1986
1987        for (i = 0; i < words.size (); i++)
1988          {
1989            const cmt_string& a = words[i];
1990
1991            //fprintf (stderr, "  a=[%s]\n", a.c_str ());
1992
1993            /// Then restore uname if the specified tag is CMTCONFIG
1994              if (a == CmtSystem::get_cmt_config ())
1995                {
1996                  Cmt::configure_uname_tag ();
1997                }
1998
1999              if (i == 0)
2000                {
2001                  cmt.m_current_tag = a;
2002
2003                  //if (!cmt.m_quiet) cerr << "parse_argument(tag_remove)> current_tag="
2004                  //<< cmt.m_current_tag << endl;
2005
2006                  tag = Tag::add (a, PriorityTag, "restore configuration", 0);
2007                }
2008              else
2009                {
2010                  tag = Tag::add (a, PriorityUserTag, "restore configuration", 0);
2011                }
2012
2013              tag->mark ();
2014          }
2015}
2016
2017void ArgParser::option_user_context ()
2018{
2019  if (CmtSystem::test_directory (arg))
2020    {
2021      cmt.m_cmt_user_context = arg;
2022    }
2023}
2024
2025void ArgParser::option_with_version_directory ()
2026{
2027  cmt.m_current_structuring_style = with_version_directory;
2028
2029  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2030  if (def != 0)
2031    {
2032      def->m_default_value = true;
2033      def->m_priority_value = false;
2034    }
2035}
2036
2037void ArgParser::option_without_version_directory ()
2038{
2039  cmt.m_current_structuring_style = without_version_directory;
2040
2041  StrategyDef* def = StrategyMgr::find_strategy ("VersionDirectory");
2042  if (def != 0)
2043    {
2044      def->m_default_value = false;
2045      def->m_priority_value = true;
2046    }
2047}
2048
2049void ArgParser::option_no_cleanup ()
2050{
2051  //cmt.m_current_setup_strategy |= SetupNoCleanup;
2052}
2053
2054void ArgParser::option_private ()
2055{
2056  cmt.m_scope_filtering_mode = reach_private_uses;
2057}
2058
2059void ArgParser::option_public ()
2060{
2061  cmt.m_scope_filtering_mode = block_private_uses;
2062}
2063
2064
2065
2066
2067
2068
2069CommandHelp::HelpMap& CommandHelp::get_help ()
2070{
2071  static CommandHelp& me = instance ();
2072
2073  return (me.m_help);
2074}
2075
2076CommandHelp::HelpTexts& CommandHelp::get_help_texts ()
2077{
2078  static CommandHelp& me = instance ();
2079
2080  return (me.m_help_texts);
2081}
2082
2083const cmt_string& CommandHelp::get_help_text (ActionType key)
2084{
2085  static const HelpTexts& help = get_help_texts ();
2086
2087  const cmt_string& h = help[key];
2088  return (h);
2089}
2090
2091void CommandHelp::show_all ()
2092{
2093  static HelpTexts& help_texts = get_help_texts ();
2094
2095  cerr << "#> cmt command [option...]" << endl;
2096  cerr << "# command :" << endl;
2097
2098  int i;
2099
2100  for (i = 0; ; i++)
2101    {
2102      const cmt_string& s = help_texts[i];
2103      if (s == "") break;
2104      cerr << "#   " << s << endl;
2105    }
2106
2107  cerr << "# global options :" << endl;
2108
2109  cerr << "#   -disable_warnings       : don't print warnings" << endl;
2110  cerr << "#   -quiet                  : don't print errors" << endl;
2111  cerr << "#   -use=<p>:<v>:<path>     : set package version path" << endl;
2112  cerr << "#   -pack=<package>         : set package" << endl;
2113  cerr << "#   -version=<version>      : set version" << endl;
2114  cerr << "#   -path=<path>            : set root path" << endl;
2115  cerr << "#   -f=<requirement-file>   : set input file" << endl;
2116  cerr << "#   -e=<statement>          : add a one line statement" << endl;
2117  cerr << "#   -tag=<tag-list>         : select a new tag-set" << endl;
2118  cerr << "#   -tag_add=<tag-list>     : add specific comma-separated tag(s)" << endl;
2119  cerr << "#   -tag_remove=<tag-list>  : remove specific comma-separated tag(s)" << endl;
2120  cerr << "#   -warnings               : display various warnings" << endl;
2121  cerr << "#   -with_version_directory : reset to default structuring style" << endl;
2122  cerr << "#   -without_version_directory : switch structuring style" << endl;
2123  cerr << "#   -cleanup                : activate install area cleanup" << endl;
2124  cerr << "#   -no_cleanup             : inhibit install area cleanup" << endl;
2125}
2126
2127void CommandHelp::show (ActionType action)
2128{
2129  //cerr << "CommandHelp::show> action = " << action << endl;
2130
2131  static HelpTexts& help_texts = get_help_texts ();
2132
2133  if (action == action_build)
2134    {
2135      int i;
2136
2137      for (i = action_build_constituent_makefile; i <= action_build_windefs; i++)
2138        {
2139          const cmt_string& s = help_texts[i];
2140          cerr << "#   " << s << endl;
2141        }
2142    }
2143  if (action == action_check)
2144    {
2145      int i;
2146
2147      for (i = action_check_configuration; i <= action_check_version; i++)
2148        {
2149          const cmt_string& s = help_texts[i];
2150          cerr << "#   " << s << endl;
2151        }
2152    }
2153  else if (action == action_show)
2154    {
2155      int i;
2156
2157      for (i = (action_show + 1); i <= action_show_versions; i++)
2158        {
2159          const cmt_string& s = help_texts[i];
2160          cerr << "#   " << s << endl;
2161        }
2162    }
2163  else
2164    {
2165      const cmt_string& s = get_help_text (action);
2166      cerr << "#" << s << endl;
2167    }
2168}
2169
2170CommandHelp& CommandHelp::instance ()
2171{
2172  static CommandHelp me;
2173  return (me);
2174}
2175
2176CommandHelp::CommandHelp ()
2177{
2178  static HelpMap& help = m_help;
2179
2180  static HelpTexts& help_texts = m_help_texts;
2181
2182  help_texts.clear ();
2183
2184  help_texts.add () =  "none";
2185  help_texts.add () =  "awk";
2186  help_texts.add () =  "broadcast [-select=list] [-exclude=list] [-local] [-global] [-begin=pattern] [-depth=n] <command> : apply a command to [some of] the used packages";
2187  help_texts.add () =  "build <option>          : build actions. (Try cmt help build)";
2188  help_texts.add () =  "build constituent_makefile <constituent>  : generate constituent Makefile fragment";
2189  help_texts.add () =  "build constituents_makefile : generate constituents.make";
2190  help_texts.add () =  "build dependencies      : generate dependencies";
2191  help_texts.add () =  "build library_links     : build symbolic links towards all imported libraries";
2192  help_texts.add () =  "build make_setup        : build a compiled version of setup scripts";
2193  help_texts.add () =  "build msdev             : generate MSDEV files";
2194  help_texts.add () =  "build CMT_pacman        : generate PACMAN manifest file for CMT";
2195  help_texts.add () =  "build vsnet             : generate VS.NET files";
2196  help_texts.add () =  "build os9_makefile      : generate Makefile for OS9";
2197  help_texts.add () =  "build prototype         : generate prototype file";
2198  help_texts.add () =  "build readme            : generate README.html";
2199  help_texts.add () =  "build tag_makefile      : generate tag specific Makefile";
2200  help_texts.add () =  "build temporary_name    : generate a name for a temprary file";
2201  help_texts.add () =  "build triggers <constituent> : generate library trigger file";
2202  help_texts.add () =  "build windefs [-name=NAME] [@commandfile] (objectfile|library)... : generate def file for Windows shared library [NAME]";
2203  help_texts.add () =  "check <option>          : check actions. (Try cmt help check)";
2204  help_texts.add () =  "check configuration     : check configuration";
2205  help_texts.add () =  "check files <old> <new> : compare two files and overrides <old> by <new> if different";
2206  help_texts.add () =  "check version <name>    : check if a name follows a version tag syntax ";
2207  help_texts.add () =  "co | checkout           : perform a cvs/svn checkout over a CMT package";
2208  help_texts.add () =  "cleanup [-csh|-sh|-bat] : generate a cleanup script";
2209  help_texts.add () =  "config                  : generate setup and cleanup scripts";
2210  help_texts.add () =  "create <package> <version> [<path>] : create and configure a new package";
2211  help_texts.add () =  "create_project <project> <name> [<path>] : create and configure a new project";
2212  help_texts.add () =  "cvsbranches <module>      : display the subdirectories for a module";
2213  help_texts.add () =  "cvssubpackages <module>   : display the subpackages for a module";
2214  help_texts.add () =  "cvssubprojects <module>   : display the subprojects for a module";
2215  help_texts.add () =  "cvstags <module>          : display the CVS tags for a module";
2216  help_texts.add () =  "do <action> [<param>=<value>] ... : Execute an action";
2217  help_texts.add () =  "expand model <model>    : ";
2218  help_texts.add () =  "filter <in> <out>       : filter a file against CMT macros and env. variables";
2219  help_texts.add () =  "help | -help | --help   : display this help";
2220  help_texts.add () =  "load";
2221  help_texts.add () =  "lock [<p> <v> [<path>]] : lock a package";
2222  help_texts.add () =  "relocate                : generate only setup scripts";
2223  help_texts.add () =  "remove <package> <version> [<path>] : remove a package version";
2224  help_texts.add () =  "remove library_links    : remove symbolic links towards all imported libraries";
2225  help_texts.add () =  "run '<command>'         : apply a command";
2226  help_texts.add () =  "run_sequence <sequence file> : execute a cmt equence file";
2227  help_texts.add () =  "set version <version>   : generate a version file in the current package";
2228  help_texts.add () =  "set versions            : generate version files into packages";
2229  help_texts.add () =  "setup [-csh|-sh|-bat]   : generate a setup script";
2230  help_texts.add () =  "show <option>           : query actions. (Try cmt help show)";
2231  help_texts.add () =  "show  action <name>     :  a formatted action definition";
2232  help_texts.add () =  "show  action_value <name> :  a raw action definition";
2233  help_texts.add () =  "show  action_names      :  all action names";
2234  help_texts.add () =  "show  actions           :  all action definitions";
2235  help_texts.add () =  "show  all_tags          :  all defined tags";
2236  help_texts.add () =  "show  applied_patterns  :  all patterns actually applied";
2237  help_texts.add () =  "show  author            :  package author";
2238  help_texts.add () =  "show  branches          :  added branches";
2239  help_texts.add () =  "show  clients           :  package clients";
2240  help_texts.add () =  "show  cmtpath_patterns  :  cmtpath_patterns";
2241  help_texts.add () =  "show  constituent <name>:  constituent definition";
2242  help_texts.add () =  "show  constituent_names :  constituent names";
2243  help_texts.add () =  "show  constituents      :  constituent definitions";
2244  help_texts.add () =  "show  cycles            :  cycles in the use graph";
2245  help_texts.add () =  "show  fragment <name>   :  one fragment definition";
2246  help_texts.add () =  "show  fragments         :  fragment definitions";
2247  help_texts.add () =  "show  groups            :  group definitions";
2248  help_texts.add () =  "show  include_dirs      :  ";
2249  help_texts.add () =  "show  language <name>   :  language definition";
2250  help_texts.add () =  "show  languages         :  language definitions";
2251  help_texts.add () =  "show  macro <name>      :  a formatted macro definition";
2252  help_texts.add () =  "show  macro_value <name>  :  a raw macro definition";
2253  help_texts.add () =  "show  macro_names       :  all macro names";
2254  help_texts.add () =  "show  macros            :  all macro definitions";
2255  help_texts.add () =  "show  manager           :  package manager";
2256  help_texts.add () =  "show  packages          :  packages reachable from the current context";
2257  help_texts.add () =  "show  path [-d]         :  the package search paths list [in detail]";
2258  help_texts.add () =  "show  pattern <name>    :  the pattern definition and usages";
2259  help_texts.add () =  "show  pattern_names     :  pattern names";
2260  help_texts.add () =  "show  patterns          :  the pattern definitions";
2261  help_texts.add () =  "show  projects          :  project definitions";
2262  help_texts.add () =  "show  project author    :  project author";
2263  help_texts.add () =  "show  setup             :  setup definitions";
2264  help_texts.add () =  "show  pwd               :  filtered current directory";
2265  help_texts.add () =  "show  set <name>        :  a formatted set definition";
2266  help_texts.add () =  "show  set_names         :  set names";
2267  help_texts.add () =  "show  set_value <name>  :  a raw set definition";
2268  help_texts.add () =  "show  sets              :  set definitions";
2269  help_texts.add () =  "show  strategies        :  all strategies (build & version)";
2270  help_texts.add () =  "show  tags              :  all currently active tags";
2271  help_texts.add () =  "show  use_paths <pack>  :  all paths to the used package";
2272  help_texts.add () =  "show  uses              :  used packages";
2273  help_texts.add () =  "show  version           :  version of the current package";
2274  help_texts.add () =  "show  versions <name>   :  visible versions of the selected package";
2275  help_texts.add () =  "system                  : display the system tag";
2276  help_texts.add () =  "unlock [<p> <v> [<path>]] : unlock a package";
2277  help_texts.add () =  "version                 : version of CMT";
2278  help_texts.add () =  "";
2279
2280  //"build <key>             : build various components :"
2281  //"show <key>              : display various infos on :"
2282
2283  help.add (action_none, help_texts[action_none]);
2284  help.add (action_awk, help_texts[action_awk]);
2285  help.add (action_broadcast, help_texts[action_broadcast]);
2286  help.add (action_build, help_texts[action_build]);
2287  help.add (action_build_constituent_makefile, help_texts[action_build_constituent_makefile]);
2288  help.add (action_build_constituents_makefile, help_texts[action_build_constituents_makefile]);
2289  help.add (action_build_dependencies, help_texts[action_build_dependencies]);
2290  help.add (action_build_library_links, help_texts[action_build_library_links]);
2291  help.add (action_build_make_setup, help_texts[action_build_make_setup]);
2292  help.add (action_build_msdev, help_texts[action_build_msdev]);
2293  help.add (action_build_CMT_pacman, help_texts[action_build_CMT_pacman]);
2294  help.add (action_build_vsnet, help_texts[action_build_vsnet]);
2295  help.add (action_build_os9_makefile, help_texts[action_build_os9_makefile]);
2296  help.add (action_build_prototype, help_texts[action_build_prototype]);
2297  help.add (action_build_readme, help_texts[action_build_readme]);
2298  help.add (action_build_tag_makefile, help_texts[action_build_tag_makefile]);
2299  help.add (action_build_temporary_name, help_texts[action_build_temporary_name]);
2300  help.add (action_build_triggers, help_texts[action_build_triggers]);
2301  help.add (action_build_windefs, help_texts[action_build_windefs]);
2302  help.add (action_check_configuration, help_texts[action_check_configuration]);
2303  help.add (action_check_files, help_texts[action_check_files]);
2304  help.add (action_check_version, help_texts[action_check_version]);
2305  help.add (action_checkout, help_texts[action_checkout]);
2306  help.add (action_cleanup, help_texts[action_cleanup]);
2307  help.add (action_config, help_texts[action_config]);
2308  help.add (action_create, help_texts[action_create]);
2309  help.add (action_create_project, help_texts[action_create_project]);
2310  help.add (action_cvsbranches, help_texts[action_cvsbranches]);
2311  help.add (action_cvssubpackages, help_texts[action_cvssubpackages]);
2312  help.add (action_cvssubprojects, help_texts[action_cvssubprojects]);
2313  help.add (action_cvstags, help_texts[action_cvstags]);
2314  help.add (action_do, help_texts[action_do]);
2315  help.add (action_expand_model, help_texts[action_expand_model]);
2316  help.add (action_filter, help_texts[action_filter]);
2317  help.add (action_help, help_texts[action_help]);
2318  help.add (action_load, help_texts[action_load]);
2319  help.add (action_lock, help_texts[action_lock]);
2320  help.add (action_relocate, help_texts[action_relocate]);
2321  help.add (action_remove, help_texts[action_remove]);
2322  help.add (action_remove_library_links, help_texts[action_remove_library_links]);
2323  help.add (action_run, help_texts[action_run]);
2324  help.add (action_run_sequence, help_texts[action_run_sequence]);
2325  help.add (action_set_version, help_texts[action_set_version]);
2326  help.add (action_set_versions, help_texts[action_set_versions]);
2327  help.add (action_setup, help_texts[action_setup]);
2328  help.add (action_show, help_texts[action_show]);
2329  help.add (action_show_action, help_texts[action_show_action]);
2330  help.add (action_show_action_value, help_texts[action_show_action_value]);
2331  help.add (action_show_action_names, help_texts[action_show_action_names]);
2332  help.add (action_show_actions, help_texts[action_show_actions]);
2333  help.add (action_show_all_tags, help_texts[action_show_all_tags]);
2334  help.add (action_show_applied_patterns, help_texts[action_show_applied_patterns]);
2335  help.add (action_show_author, help_texts[action_show_author]);
2336  help.add (action_show_branches, help_texts[action_show_branches]);
2337  help.add (action_show_clients, help_texts[action_show_clients]);
2338  help.add (action_show_cmtpath_patterns, help_texts[action_show_cmtpath_patterns]);
2339  help.add (action_show_constituent, help_texts[action_show_constituent]);
2340  help.add (action_show_constituent_names, help_texts[action_show_constituent_names]);
2341  help.add (action_show_constituents, help_texts[action_show_constituents]);
2342  help.add (action_show_cycles, help_texts[action_show_cycles]);
2343  help.add (action_show_fragment, help_texts[action_show_fragment]);
2344  help.add (action_show_fragments, help_texts[action_show_fragments]);
2345  help.add (action_show_groups, help_texts[action_show_groups]);
2346  help.add (action_show_include_dirs, help_texts[action_show_include_dirs]);
2347  help.add (action_show_language, help_texts[action_show_language]);
2348  help.add (action_show_languages, help_texts[action_show_languages]);
2349  help.add (action_show_macro, help_texts[action_show_macro]);
2350  help.add (action_show_macro_value, help_texts[action_show_macro_value]);
2351  help.add (action_show_macro_names, help_texts[action_show_macro_names]);
2352  help.add (action_show_macros, help_texts[action_show_macros]);
2353  help.add (action_show_manager, help_texts[action_show_manager]);
2354  help.add (action_show_packages, help_texts[action_show_packages]);
2355  help.add (action_show_path, help_texts[action_show_path]);
2356  help.add (action_show_pattern, help_texts[action_show_pattern]);
2357  help.add (action_show_pattern_names, help_texts[action_show_pattern_names]);
2358  help.add (action_show_patterns, help_texts[action_show_patterns]);
2359  help.add (action_show_projects, help_texts[action_show_projects]);
2360  help.add (action_show_project_author, help_texts[action_show_project_author]);
2361  help.add (action_show_setup, help_texts[action_show_setup]);
2362  help.add (action_show_pwd, help_texts[action_show_pwd]);
2363  help.add (action_show_set, help_texts[action_show_set]);
2364  help.add (action_show_set_names, help_texts[action_show_set_names]);
2365  help.add (action_show_set_value, help_texts[action_show_set_value]);
2366  help.add (action_show_sets, help_texts[action_show_sets]);
2367  help.add (action_show_strategies, help_texts[action_show_strategies]);
2368  help.add (action_show_tags, help_texts[action_show_tags]);
2369  help.add (action_show_use_paths, help_texts[action_show_use_paths]);
2370  help.add (action_show_uses, help_texts[action_show_uses]);
2371  help.add (action_show_version, help_texts[action_show_version]);
2372  help.add (action_show_versions, help_texts[action_show_versions]);
2373  help.add (action_system, help_texts[action_system]);
2374  help.add (action_unlock, help_texts[action_unlock]);
2375  help.add (action_version, help_texts[action_version]);
2376}
2377
Note: See TracBrowser for help on using the repository browser.