Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
cltools
Manual.cpp
Go to the documentation of this file.
1
/* +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2
Copyright (c) 2013 The plumed team
3
(see the PEOPLE file at the root of the distribution for a list of names)
4
5
See http://www.plumed-code.org for more information.
6
7
This file is part of plumed, version 2.0.
8
9
plumed is free software: you can redistribute it and/or modify
10
it under the terms of the GNU Lesser General Public License as published by
11
the Free Software Foundation, either version 3 of the License, or
12
(at your option) any later version.
13
14
plumed is distributed in the hope that it will be useful,
15
but WITHOUT ANY WARRANTY; without even the implied warranty of
16
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
GNU Lesser General Public License for more details.
18
19
You should have received a copy of the GNU Lesser General Public License
20
along with plumed. If not, see <http://www.gnu.org/licenses/>.
21
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ */
22
#include "
CLTool.h
"
23
#include "
CLToolRegister.h
"
24
#include "tools/Tools.h"
25
#include "config/Config.h"
26
#include "core/ActionRegister.h"
27
#include <cstdio>
28
#include <string>
29
#include <vector>
30
#include <iostream>
31
32
using namespace
std
;
33
34
namespace
PLMD
{
35
namespace
cltools{
36
37
//+PLUMEDOC TOOLS manual
38
/*
39
manual is a tool that you can use to construct the manual page for
40
a particular action
41
42
The manual constructed by this action is in html. In all probability you will never need to use this
43
tool. However, it is used within the scripts that generate plumed's html manual. If you need to use this
44
tool outside those scripts the input is specified using the following command line arguments.
45
46
\par Examples
47
48
The following generates the html manual for the action DISTANCE.
49
\verbatim
50
plumed manual --action DISTANCE
51
\endverbatim
52
53
54
*/
55
//+ENDPLUMEDOC
56
57
class
Manual
:
58
public
CLTool
59
{
60
public
:
61
static
void
registerKeywords(
Keywords
& keys );
62
Manual
(
const
CLToolOptions
& co );
63
int
main
(FILE* in, FILE*out,
Communicator
& pc);
64
string
description
()
const
{
65
return
"print out a description of the keywords for an action in html"
;
66
}
67
};
68
69
PLUMED_REGISTER_CLTOOL(Manual,
"manual"
)
70
71
void
Manual
::registerKeywords(
Keywords
& keys ){
72
CLTool::registerKeywords( keys );
73
keys.add(
"compulsory"
,
"--action"
,
"print the manual for this particular action"
);
74
}
75
76
Manual::Manual(
const
CLToolOptions
& co ):
77
CLTool
(co)
78
{
79
inputdata
=
commandline
;
80
}
81
82
int
Manual::main
(FILE* in, FILE*out,
Communicator
& pc){
83
84
std::string action;
85
if
( !
parse
(
"--action"
,action) )
return
1;
86
std::cerr<<
"LIST OF DOCUMENTED ACTIONS:\n"
;
87
std::cerr<<
actionRegister
()<<
"\n"
;
88
std::cerr<<
"LIST OF DOCUMENTED COMMAND LINE TOOLS:\n"
;
89
std::cerr<<
cltoolRegister
()<<
"\n\n"
;
90
if
( !
actionRegister
().printManual(action) && !
cltoolRegister
().printManual(action) ){
91
fprintf(stderr,
"specified action is not registered\n"
);
92
return
1;
93
}
94
95
return
0;
96
}
97
98
}
// End of namespace
99
}
PLMD::actionRegister
ActionRegister & actionRegister()
Definition:
ActionRegister.cpp:40
CLToolRegister.h
PLMD::cltools::Manual
Definition:
Manual.cpp:57
main
int main(int argc, char **argv)
This main uses only the interface published in Plumed.h.
Definition:
main.cpp:38
PLMD::Communicator
Class containing wrappers to MPI.
Definition:
Communicator.h:44
std
STL namespace.
PLMD::CLTool
This is the abstract base class to use for implementing new command line tool, within it there is inf...
Definition:
CLTool.h:55
PLMD::Keywords
This class holds the keywords and their documentation.
Definition:
Keywords.h:36
PLMD::CLToolOptions
Definition:
CLTool.h:36
PLMD::CLTool::commandline
Definition:
CLTool.h:89
PLMD::cltoolRegister
CLToolRegister & cltoolRegister()
Definition:
CLToolRegister.cpp:40
CLTool.h
PLMD::CLTool::parse
bool parse(const std::string &key, T &t)
Get the value of one of the command line arguments.
Definition:
CLTool.h:104
PLMD::cltools::Manual::main
int main(FILE *in, FILE *out, Communicator &pc)
virtual function mapping to the specific main for each tool
Definition:
Manual.cpp:82
PLMD::CLTool::inputdata
enum PLMD::CLTool::@0 inputdata
How is the input specified on the command line or in an input file.
PLMD::cltools::Manual::description
string description() const
virtual function returning a one-line descriptor for the tool
Definition:
Manual.cpp:64
PLMD
Definition:
Analysis.cpp:30
Hosted by GitHub
1.8.8