Line |
Branch |
Exec |
Source |
1 |
|
|
/** |
2 |
|
|
* This file is part of the CernVM File System. |
3 |
|
|
*/ |
4 |
|
|
|
5 |
|
|
#ifndef CVMFS_PUBLISH_CMD_HASH_H_ |
6 |
|
|
#define CVMFS_PUBLISH_CMD_HASH_H_ |
7 |
|
|
|
8 |
|
|
#include <string> |
9 |
|
|
|
10 |
|
|
#include "publish/command.h" |
11 |
|
|
|
12 |
|
|
namespace publish { |
13 |
|
|
|
14 |
|
|
class CmdHash : public Command { |
15 |
|
|
public: |
16 |
|
✗ |
virtual std::string GetName() const { return "hash"; } |
17 |
|
✗ |
virtual std::string GetBrief() const { |
18 |
|
✗ |
return "CernVM-FS hash functions"; |
19 |
|
|
} |
20 |
|
✗ |
virtual std::string GetDescription() const { |
21 |
|
|
return "Hash over a string or STDIN with one of the hash functions in " |
22 |
|
✗ |
"CernVM-FS"; |
23 |
|
|
} |
24 |
|
✗ |
virtual ParameterList GetParams() const { |
25 |
|
✗ |
ParameterList p; |
26 |
|
✗ |
p.push_back(Parameter::Mandatory("algorithm", 'a', "algorithm name", |
27 |
|
|
"hash algorithm to use (e.g. shake128, sha1)")); |
28 |
|
✗ |
p.push_back(Parameter::Optional("input", 'i', "string", |
29 |
|
|
"data to hash over (instead of STDIN)")); |
30 |
|
✗ |
p.push_back(Parameter::Switch("fingerprint", 'f', |
31 |
|
|
"print in fingerprint representation")); |
32 |
|
✗ |
p.push_back(Parameter::Switch("split", 's', |
33 |
|
|
"additionally print the hash as 64bit integer tuples")); |
34 |
|
✗ |
return p; |
35 |
|
|
} |
36 |
|
✗ |
virtual bool IsHidden() const { return true; } |
37 |
|
|
|
38 |
|
|
virtual int Main(const Options &options); |
39 |
|
|
}; |
40 |
|
|
|
41 |
|
|
} // namespace publish |
42 |
|
|
|
43 |
|
|
#endif // CVMFS_PUBLISH_CMD_HASH_H_ |
44 |
|
|
|