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

Last change on this file since 428 was 428, checked in by rybkin, 17 years ago

See C.L. 334

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