CernVM-FS  2.13.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmd_abort.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_PUBLISH_CMD_ABORT_H_
6 #define CVMFS_PUBLISH_CMD_ABORT_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "publish/command.h"
12 
13 namespace publish {
14 
15 class CmdAbort : public Command {
16  public:
17  virtual std::string GetName() const { return "abort"; }
18  virtual std::string GetBrief() const {
19  return "Abort the currently open transaction";
20  }
21  virtual std::string GetDescription() const {
22  return "Returns to the state before the current transaction was opened. "
23  "All changes staged in the current transaction are discarded. "
24  "Repositories attached to a gateway return their lease.";
25  }
26  virtual std::string GetUsage() const { return "[options] <repository name>"; }
27  virtual std::vector<std::string> DoGetExamples() const {
28  std::vector<std::string> e;
29  e.push_back("-f myrepo.cvmfs.io "
30  "# abort without asking for confirmation");
31  return e;
32  }
33  virtual ParameterList GetParams() const {
34  ParameterList p;
35  p.push_back(Parameter::Switch("force", 'f', "Do not ask for confirmation"));
36  return p;
37  }
38 
39  virtual int Main(const Options &options);
40 }; // class CmdAbort
41 
42 } // namespace publish
43 
44 #endif // CVMFS_PUBLISH_CMD_ABORT_H_
virtual std::string GetName() const
Definition: cmd_abort.h:17
virtual std::string GetUsage() const
Definition: cmd_abort.h:26
static Parameter Switch(const std::string &key, char short_key, const std::string &desc)
Definition: command.h:74
virtual std::string GetDescription() const
Definition: cmd_abort.h:21
std::vector< Parameter > ParameterList
Definition: command.h:86
virtual ParameterList GetParams() const
Definition: cmd_abort.h:33
virtual std::vector< std::string > DoGetExamples() const
Definition: cmd_abort.h:27
virtual std::string GetBrief() const
Definition: cmd_abort.h:18
virtual int Main(const Options &options)
Definition: cmd_abort.cc:36