]> git.saurik.com Git - apt.git/blobdiff - apt-pkg/contrib/cmndline.h
split up help messages for simpler reuse
[apt.git] / apt-pkg / contrib / cmndline.h
index 9f505fd410547edc8fc2678872a2caa4dfe08e64..a698a18b84f55f79b0b0aa068420578ee50d760e 100644 (file)
@@ -44,6 +44,8 @@
 #ifndef PKGLIB_CMNDLINE_H
 #define PKGLIB_CMNDLINE_H
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 #include <apt-pkg/configuration.h>
 #endif
@@ -55,6 +57,7 @@ class CommandLine
    public:
    struct Args;
    struct Dispatch;
+   struct DispatchWithHelp;
    
    protected:
    
@@ -80,9 +83,20 @@ class CommandLine
    
    bool Parse(int argc,const char **argv);
    void ShowHelp();
-   unsigned int FileSize() const;
+   unsigned int FileSize() const APT_PURE;
    bool DispatchArg(Dispatch *List,bool NoMatch = true);
+   bool DispatchArg(DispatchWithHelp *List,bool NoMatch = true);
       
+   static char const * GetCommand(Dispatch const * const Map,
+        unsigned int const argc, char const * const * const argv) APT_PURE;
+   static char const * GetCommand(DispatchWithHelp const * const Map,
+        unsigned int const argc, char const * const * const argv) APT_PURE;
+
+
+   static CommandLine::Args MakeArgs(char ShortOpt, char const *LongOpt,
+        char const *ConfName, unsigned long Flags) APT_CONST;
+
+   CommandLine();
    CommandLine(Args *AList,Configuration *Conf);
    ~CommandLine();
 };
@@ -103,5 +117,11 @@ struct CommandLine::Dispatch
    const char *Match;
    bool (*Handler)(CommandLine &);
 };
+struct CommandLine::DispatchWithHelp
+{
+   const char *Match;
+   bool (*Handler)(CommandLine &);
+   const char *Help;
+};
 
 #endif