diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-06-28 15:00:57 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-06-28 15:00:57 (GMT) |
commit | c95dc91237436b363772c418d4d0d2d1203f6119 (patch) | |
tree | 20a734f677ed90e02be1baf6e57c35ca3f1bc615 /Source/cmDocumentation.h | |
parent | 789f0b26d9d18c4f020637ec1d63d25923765ab3 (diff) | |
download | CMake-c95dc91237436b363772c418d4d0d2d1203f6119.zip CMake-c95dc91237436b363772c418d4d0d2d1203f6119.tar.gz CMake-c95dc91237436b363772c418d4d0d2d1203f6119.tar.bz2 |
ENH:
-in the full documentation there is now an extra section for
compatibility commands, so users see which commands they shouldn't use
-cmake -h <command> now also works with lower case commands
--help-fullm --help-command, --help-module and --help-property now determine
the output format from the extension of the given filename
Let me know if there are some things I overlooked.
Alex
Diffstat (limited to 'Source/cmDocumentation.h')
-rw-r--r-- | Source/cmDocumentation.h | 33 |
1 files changed, 20 insertions, 13 deletions
diff --git a/Source/cmDocumentation.h b/Source/cmDocumentation.h index 9962297..b54c904 100644 --- a/Source/cmDocumentation.h +++ b/Source/cmDocumentation.h @@ -31,7 +31,7 @@ public: /** Types of help provided. */ enum Type { None, Usage, Single, SingleModule, SingleProperty, List, ModuleList, PropertyList, - Full, HTML, Man, Copyright, Version }; + Full, Copyright, Version }; /** * Check command line arguments for documentation options. Returns @@ -113,12 +113,8 @@ public: { return (form==ManForm?this->ManName.c_str():this->Name.c_str()); } /** Return a pointer to the first entry of this section. */ - cmDocumentationEntry *GetEntries() - { return &this->Entries[0]; } - - /** Return a pointer to the first entry of this section. */ const cmDocumentationEntry *GetEntries() const - { return &this->Entries[0]; } + { return this->Entries.empty()?&this->EmptySection:&this->Entries[0];} /** Append an entry to this section. */ void Append(const cmDocumentationEntry& entry) @@ -133,6 +129,8 @@ public: std::string Name; std::string ManName; std::vector<cmDocumentationEntry> Entries; + static const cmDocumentationEntry EmptySection; + }; /** @@ -162,6 +160,9 @@ public: /** Set cmake root so we can find installed files */ void SetCMakeRoot(const char* root) { this->CMakeRoot = root;} + + static Form GetFormFromFilename(const std::string& filename); + private: void PrintHeader(const char* title, std::ostream& os); void PrintFooter(std::ostream& os); @@ -205,7 +206,7 @@ private: bool PrintDocumentationUsage(std::ostream& os); bool PrintDocumentationFull(std::ostream& os); void PrintDocumentationCommand(std::ostream& os, - cmDocumentationEntry* entry); + const cmDocumentationEntry* entry); void CreateUsageDocumentation(); void CreateFullDocumentation(); @@ -236,19 +237,25 @@ private: cmSection AuthorSection; std::string SeeAlsoString; - std::string SingleCommand; - std::string SingleModuleName; - std::string SinglePropertyName; std::string CMakeRoot; std::vector< char* > ModuleStrings; std::vector< const char* > Names; std::vector< const cmDocumentationEntry* > Sections; Form CurrentForm; + std::string CurrentArgument; const char* TextIndent; int TextWidth; - - typedef std::map<Type, cmStdString> RequestedMapType; - RequestedMapType RequestedMap; + + struct RequestedHelpItem + { + RequestedHelpItem():Form(TextForm), Type(None) {} + cmDocumentation::Form Form; + cmDocumentation::Type Type; + std::string Filename; + std::string Argument; + }; + + std::vector<RequestedHelpItem> RequestedHelpItems; }; #endif |