summaryrefslogtreecommitdiff
path: root/httpupargparser.cpp
blob: d52c883c558ebb8a3de6bd89e561ccf793b267db (plain)
    1 ////////////////////////////////////////////////////////////////////////
    2 // FILE:        httpupargparser.cpp
    3 // AUTHOR:      Johannes Winkelmann, jw@tks6.net
    4 // COPYRIGHT:   (c) 2005 by Johannes Winkelmann
    5 // ---------------------------------------------------------------------
    6 //  This program is free software; you can redistribute it and/or modify
    7 //  it under the terms of the GNU General Public License as published by
    8 //  the Free Software Foundation; either version 2 of the License, or
    9 //  (at your option) any later version.
   10 ////////////////////////////////////////////////////////////////////////
   11 
   12 
   13 #include "httpupargparser.h"
   14 
   15 ArgParser::APCmd HttpupArgparser::CMD_SYNC;
   16 ArgParser::APCmd HttpupArgparser::CMD_COPY;
   17 ArgParser::APCmd HttpupArgparser::CMD_LIST;
   18 
   19 ArgParser::APOpt HttpupArgparser::OPT_REPOFILE;
   20 ArgParser::APOpt HttpupArgparser::OPT_ENCODE;
   21 ArgParser::APOpt HttpupArgparser::OPT_VERIFY_MD5;
   22 
   23 
   24 HttpupArgparser::HttpupArgparser()
   25 {
   26     // - sync
   27     addCommand(CMD_SYNC, "sync",
   28                "syncronize local copy with remote repository",
   29                ArgParser::MAX, 2, "[url] [target dir]");
   30 
   31     OPT_REPOFILE.init("repofile",
   32                       'r',
   33                       "alternative name for REPO file",
   34                       true,
   35                       "NAME");
   36 
   37     OPT_ENCODE.init("encode",
   38                     'e',
   39                     "encode special chars in URL");
   40 
   41     OPT_VERIFY_MD5.init("verify-md5",
   42                     'm',
   43                     "verify md5sum of downloaded files");
   44 
   45     addOption(CMD_SYNC, OPT_REPOFILE, false);
   46     addOption(CMD_SYNC, OPT_ENCODE, false);
   47     addOption(CMD_SYNC, OPT_VERIFY_MD5, false);
   48 
   49 
   50     // - copy
   51     addCommand(CMD_COPY, "copy",
   52                "copy a remote repository to a local directory",
   53                ArgParser::EQ, 2, "<url> <target dir>");
   54     addOption(CMD_COPY, OPT_REPOFILE, false);
   55     addOption(CMD_COPY, OPT_ENCODE, false);
   56     addOption(CMD_SYNC, OPT_VERIFY_MD5, false);
   57 
   58     // - list
   59     addCommand(CMD_LIST, "list",
   60                "list files in <directory> which are controlled by httpup",
   61                ArgParser::MAX, 1, "<directory>");
   62     addOption(CMD_LIST, OPT_REPOFILE, false);
   63 }

Generated by cgit