diff --git a/src/core/ActionRegister.cpp b/src/core/ActionRegister.cpp index aff321fd47f330409e9a21509ace32ec6215c8b0..b68527d48e3463b69bdafec8abf51cb362df2fc8 100644 --- a/src/core/ActionRegister.cpp +++ b/src/core/ActionRegister.cpp @@ -85,11 +85,13 @@ std::unique_ptr<Action> ActionRegister::create(const ActionOptions&ao) { return action; } -bool ActionRegister::printManual( const std::string& action, const bool& vimout ) { +bool ActionRegister::printManual( const std::string& action, const bool& vimout, const bool& spellout ) { if ( check(action) ) { Keywords keys; mk[action](keys); if( vimout ) { printf("%s",action.c_str()); keys.print_vim(); printf("\n"); + } else if( spellout ) { + keys.print_spelling(); } else { keys.print_html(); } diff --git a/src/core/ActionRegister.h b/src/core/ActionRegister.h index 475d73e25b863c52a825f4cc8f76d3c90ae1b72a..8c508bfeb585133cfbe756a0cc036291659feedc 100644 --- a/src/core/ActionRegister.h +++ b/src/core/ActionRegister.h @@ -68,7 +68,7 @@ public: /// \param ao object containing information for initialization, such as the full input line, a pointer to PlumedMain, etc std::unique_ptr<Action> create(const ActionOptions&ao); /// Print out the keywords for an action in html/vim ready for input into the manual - bool printManual(const std::string& action, const bool& vimout); + bool printManual(const std::string& action, const bool& vimout, const bool& spellout); /// Print out a template command for an action bool printTemplate(const std::string& action, bool include_optional); void remove(creator_pointer); diff --git a/src/core/CLToolRegister.cpp b/src/core/CLToolRegister.cpp index 4a7f740dd5d2bb2ee6eaa7dd233a3531903b70f5..2bc3f3b10819220ed0c76171c178c460ab6b3eae 100644 --- a/src/core/CLToolRegister.cpp +++ b/src/core/CLToolRegister.cpp @@ -92,8 +92,11 @@ std::ostream & operator<<(std::ostream &log,const CLToolRegister&ar) { return log; } -bool CLToolRegister::printManual( const std::string& cltool ) { - if ( check(cltool) ) { +bool CLToolRegister::printManual( const std::string& cltool, const bool& spelling ) { + if( spelling && check(cltool) ) { + mk[cltool].print_spelling(); + return true; + } else if ( check(cltool) ) { mk[cltool].print_html(); return true; } else { diff --git a/src/core/CLToolRegister.h b/src/core/CLToolRegister.h index d03f0338ccb7ed708578062ffe770c5fb9b0fa5a..4e3197a53f6915fccaa21a192b71041941302c1d 100644 --- a/src/core/CLToolRegister.h +++ b/src/core/CLToolRegister.h @@ -65,7 +65,7 @@ public: /// Returns a list of the allowed CLTools std::vector<std::string> list()const; /// Print out the instructions for using the tool in html ready for input into the manual - bool printManual(const std::string& cltool); + bool printManual(const std::string& cltool,const bool& spelling); /// Return all the keys of this cltool std::vector<std::string> getKeys(const std::string& cltool)const; }; diff --git a/src/tools/Keywords.cpp b/src/tools/Keywords.cpp index 26786380987fc966359a72290aa4d640b85d93f8..ac8b5cdc556a5f7dc05f5a88be81f217622e3f4a 100644 --- a/src/tools/Keywords.cpp +++ b/src/tools/Keywords.cpp @@ -447,6 +447,11 @@ void Keywords::print_html() const { std::cout<<"</table>\n\n"; } +void Keywords::print_spelling() const { + for(unsigned i=0; i<keys.size(); ++i) printf("%s\n", keys[i].c_str() ); + for(unsigned i=0; i<cnames.size(); ++i) printf("%s\n",cnames[i].c_str() ); +} + void Keywords::print( FILE* out ) const { unsigned nkeys=0; for(unsigned i=0; i<keys.size(); ++i) { diff --git a/src/tools/Keywords.h b/src/tools/Keywords.h index a94cfe6c4f4cd3be856fe2c6bc8f3f753402c353..5af9caa184efafe2de4e6cc4b915237dbe99fb52 100644 --- a/src/tools/Keywords.h +++ b/src/tools/Keywords.h @@ -113,6 +113,8 @@ public: void print( Log& log ) const ; /// Print the documentation to a file (use by PLUMED::CLTool::readCommandLineArgs) void print( FILE* out ) const ; +/// Print a file containing the list of keywords for a particular action (used for spell checking) + void print_spelling() const ; /// Reserve a keyword void reserve( const std::string & t, const std::string & k, const std::string & d ); /// Reserve a flag diff --git a/user-doc/.gitignore b/user-doc/.gitignore index a187357cd798e4938fa2ac28ba583e589c8a6725..139073b02272c2415c636c5cdc237623e24a8bf1 100644 --- a/user-doc/.gitignore +++ b/user-doc/.gitignore @@ -10,4 +10,5 @@ /*doc* /manual.pdf /regtests +/spelling