source: CMT/HEAD/source/cmt_commands.h @ 181

Last change on this file since 181 was 181, checked in by garonne, 18 years ago

add the cmt relocate command

  • 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_relocate ();
52  void do_remove   ();
53  void do_run      ();
54  void do_run_sequence ();
55  void do_set ();
56  void do_setup ();
57  void do_show ();
58  void do_system ();
59  void do_unlock ();
60  void do_version ();
61  void option_help ();
62  void option_n ();
63  void option_quiet ();
64  void option_warnings ();
65  void option_csh ();
66  void option_sh ();
67  void option_bat ();
68  void option_use ();
69  void option_pack ();
70  void option_version ();
71  void option_path ();
72  void option_f ();
73  void option_e ();
74  void option_home ();
75  void option_tag ();
76  void option_tag_add ();
77  void option_tag_remove ();
78  void option_user_context ();
79  void option_with_version_directory ();
80  void option_without_version_directory ();
81  void option_no_cleanup ();
82  void option_private ();
83  void option_public ();
84
85  void shift ();
86  void unshift ();
87  void fill_arguments ();
88  cmt_string& fill_one_argument ();
89  cmt_string& fill_one_argument_filtered ();
90
91  CmtContext& cmt;
92
93  cmt_vmap <cmt_string, int> parsers;
94  cmt_vector <parser> pv;
95
96};
97
98class CommandHelp
99{
100public:
101  typedef cmt_map <ActionType, cmt_string> HelpMap;
102  typedef cmt_vector <cmt_string> HelpTexts;
103
104  static HelpMap& get_help ();
105  static HelpTexts& get_help_texts ();
106  static const cmt_string& get_help_text (ActionType key);
107  static void show_all ();
108  static void show (ActionType action);
109
110private:
111  static CommandHelp& instance ();
112
113  CommandHelp ();
114
115  HelpMap m_help;
116  HelpTexts m_help_texts;
117};
118
119#endif
Note: See TracBrowser for help on using the repository browser.