source: CMT/v1r18p20051108/source/cmt_commands.h @ 653

Last change on this file since 653 was 109, checked in by arnault, 19 years ago

First implementation of a -warnings option.

  • Property svn:eol-style set to native
File size: 2.5 KB
Line 
1//-----------------------------------------------------------
2// Copyright Christian Arnault LAL-Orsay CNRS
3// arnault@lal.in2p3.fr
4// See the complete license in cmt_license.txt "http://www.cecill.info".
5//-----------------------------------------------------------
6
7#ifndef __cmt_commands_h__
8#define __cmt_commands_h__
9
10#include "cmt_map.h"
11#include "cmt.h"
12
13class ArgParser
14{
15public:
16  typedef void (ArgParser::* parser) (void);
17
18  ArgParser (CmtContext& context);
19
20  void parse ();
21
22  int argc;
23  char** argv;
24  cmt_string arg;
25  CmtSystem::cmt_string_vector arguments;
26  cmt_string extra_line;
27  cmt_string extra_file;
28  PrintMode mode;
29  ActionType help_action;
30
31private:
32  void do_awk ();
33  void do_broadcast ();
34  void do_build ();
35  void do_check ();
36  void do_check_files ();
37  void do_checkout ();
38  void do_cleanup ();
39  void do_config ();
40  void do_create ();
41  void do_create_project ();
42  void do_cvsbranches ();
43  void do_cvssubpackages ();
44  void do_cvssubprojects ();
45  void do_cvstags ();
46  void do_do ();
47  void do_expand ();
48  void do_filter ();
49  void do_help ();
50  void do_lock ();
51  void do_remove ();
52  void do_run ();
53  void do_run_sequence ();
54  void do_set ();
55  void do_setup ();
56  void do_show ();
57  void do_system ();
58  void do_unlock ();
59  void do_version ();
60  void option_help ();
61  void option_n ();
62  void option_quiet ();
63  void option_warnings ();
64  void option_csh ();
65  void option_sh ();
66  void option_bat ();
67  void option_use ();
68  void option_pack ();
69  void option_version ();
70  void option_path ();
71  void option_f ();
72  void option_e ();
73  void option_home ();
74  void option_tag ();
75  void option_tag_add ();
76  void option_tag_remove ();
77  void option_user_context ();
78  void option_with_version_directory ();
79  void option_without_version_directory ();
80  void option_no_cleanup ();
81  void option_private ();
82  void option_public ();
83
84  void shift ();
85  void unshift ();
86  void fill_arguments ();
87  cmt_string& fill_one_argument ();
88  cmt_string& fill_one_argument_filtered ();
89
90  CmtContext& cmt;
91
92  cmt_vmap <cmt_string, int> parsers;
93  cmt_vector <parser> pv;
94
95};
96
97class CommandHelp
98{
99public:
100  typedef cmt_map <ActionType, cmt_string> HelpMap;
101  typedef cmt_vector <cmt_string> HelpTexts;
102
103  static HelpMap& get_help ();
104  static HelpTexts& get_help_texts ();
105  static const cmt_string& get_help_text (ActionType key);
106  static void show_all ();
107  static void show (ActionType action);
108
109private:
110  static CommandHelp& instance ();
111
112  CommandHelp ();
113
114  HelpMap m_help;
115  HelpTexts m_help_texts;
116};
117
118#endif
Note: See TracBrowser for help on using the repository browser.