CernVM-FS  2.12.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
cmd_diff.h
Go to the documentation of this file.
1 
5 #ifndef CVMFS_PUBLISH_CMD_DIFF_H_
6 #define CVMFS_PUBLISH_CMD_DIFF_H_
7 
8 #include <string>
9 #include <vector>
10 
11 #include "publish/command.h"
12 
13 namespace publish {
14 
15 class CmdDiff : public Command {
16  public:
17  virtual std::string GetName() const { return "diff"; }
18  virtual std::string GetBrief() const {
19  return "Show the change set between two repository revisions";
20  }
21  virtual std::string GetDescription() const {
22  return "Shows the added, removed, and modified files between any two "
23  "repository revisions. By default, shows the difference between the "
24  "current and the previous revision. The repository revision can be given "
25  "by a tag name or by the root hash. In the latter case, the hash needs to "
26  "start with a '@' symbol to distinguish it from a name.";
27  }
28  virtual std::string GetUsage() const {
29  return "[options] <repository name / url>";
30  }
31  virtual std::vector<std::string> DoGetExamples() const {
32  std::vector<std::string> e;
33  e.push_back("-k /etc/cvmfs/keys/cern.ch "
34  "http://cvmfs-stratum-one.cern.ch/cvmfs/grid.cern.ch "
35  " # use with any repository for which public keys are available");
36  e.push_back("myrepo.cvmfs.io "
37  "# use with a local stratum 0 or stratum 1 copy");
38  e.push_back("--from version1 --to version2 "
39  "# compare tags for the one and only stratum 0 or stratum 1 copy "
40  "available on this node");
41  return e;
42  }
43  virtual ParameterList GetParams() const {
44  ParameterList p;
45  p.push_back(Parameter::Optional("keychain", 'k', "directory",
46  "Path to the directory containing the repository public key"));
47  p.push_back(Parameter::Switch("machine-readable", 'm',
48  "Produce machine readable output"));
49  p.push_back(Parameter::Optional("from", 's', "repository tag",
50  "The source tag name [default='trunk-previous']"));
51  p.push_back(Parameter::Optional("to", 'd', "repository tag",
52  "The destination tag name [default='trunk']"));
53  p.push_back(Parameter::Switch("worktree", 'w',
54  "Show the diff of the unpublished changes in the open transaction"));
55  p.push_back(Parameter::Switch("header", 'h', "Show the header line"));
56  p.push_back(Parameter::Switch("ignore-timediff", 'i',
57  "Ignore changes that only differ in their timestamps"));
58  return p;
59  }
60 
61  virtual int Main(const Options &options);
62 }; // class CmdDiff
63 
64 } // namespace publish
65 
66 #endif // CVMFS_PUBLISH_CMD_DIFF_H_
virtual std::string GetBrief() const
Definition: cmd_diff.h:18
static Parameter Optional(const std::string &key, char short_key, const std::string &arg_name, const std::string &desc)
Definition: command.h:73
virtual std::vector< std::string > DoGetExamples() const
Definition: cmd_diff.h:31
virtual ParameterList GetParams() const
Definition: cmd_diff.h:43
static Parameter Switch(const std::string &key, char short_key, const std::string &desc)
Definition: command.h:79
virtual std::string GetName() const
Definition: cmd_diff.h:17
virtual std::string GetUsage() const
Definition: cmd_diff.h:28
virtual std::string GetDescription() const
Definition: cmd_diff.h:21
std::vector< Parameter > ParameterList
Definition: command.h:92
virtual int Main(const Options &options)
Definition: cmd_diff.cc:221