13 const bool publish = args.count(
'p') > 0;
14 const bool subscribe = args.count(
's') > 0;
16 if (publish == subscribe) {
18 "Either the \"publish\" (-p) or the \"subscribe\" (-s) option "
23 if (publish && (args.count(
'r') == 0)) {
25 "A repository URL (-r) needs to be provided when using the "
30 if (subscribe && (args.count(
't') == 0)) {
32 "A subscription topic (-t) needs to be provided when using the "
41 if (args.count(
'm') > 0) {
42 return std::atoi(args.find(
'm')->second->c_str());
50 namespace swissknife {
64 'c',
"run continuously (don't exit after first notification)"));
75 bool verbose = args.count(
'v') > 0;
76 std::string server_url = *args.find(
'u')->second;
77 bool publish = args.count(
'p') > 0;
79 std::string repository_url = *args.find(
'r')->second;
82 std::string topic = *args.find(
't')->second;
83 bool continuous = args.count(
'c') > 0;
static Parameter Optional(const char key, const std::string &desc)
static Parameter Switch(const char key, const std::string &desc)
std::vector< Parameter > ParameterList
int DoSubscribe(const std::string &server_url, const std::string &repo, uint64_t min_revision, bool continuous, bool verbose)
int DoPublish(const std::string &server_url, const std::string &repository_url, bool verbose)
static Parameter Mandatory(const char key, const std::string &desc)
virtual int Main(const ArgumentList &args)
std::map< char, SharedPtr< std::string > > ArgumentList
virtual ParameterList GetParams() const
bool ValidateArgs(const swissknife::ArgumentList &args)
uint64_t GetMinRevision(const swissknife::ArgumentList &args)
CVMFS_EXPORT void LogCvmfs(const LogSource source, const int mask, const char *format,...)