Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Public Member Functions | Public Attributes | List of all members
cli_options Class Reference

Public Member Functions

 cli_options ()
 
void parse (int argc, char **argv)
 
void usage () const
 

Public Attributes

po::options_description desc
 
po::options_description all_desc
 
po::positional_options_description pos
 
std::string command
 
bool help
 
std::string powersoftau_file
 
size_t degree
 
bool verbose
 
bool check
 
bool dummy
 
std::string out
 
size_t lagrange_degree
 

Detailed Description

Definition at line 33 of file pot_process.cpp.

Constructor & Destructor Documentation

◆ cli_options()

cli_options::cli_options ( )

Definition at line 55 of file pot_process.cpp.

56  : desc("Options")
57  , all_desc("")
58  , pos()
59  , command("pot-process")
60  , help(false)
62  , degree(0)
63  , verbose(false)
64  , check(false)
65  , dummy(false)
66  , out()
67  , lagrange_degree(0)
68 {
69  desc.add_options()("help,h", "This help")("verbose,v", "Verbose output")(
70  "check", "Check pot well-formedness and exit")(
71  "out,o", po::value<std::string>(), "Output file")(
72  "lagrange-degree", po::value<size_t>(), "Use degree l")(
73  "dummy", "Create dummy powersoftau data (!for testing only)");
74  all_desc.add(desc).add_options()(
75  "powersoftau_file", po::value<std::string>(), "powersoftau file")(
76  "degree", po::value<size_t>(), "degree");
77  pos.add("powersoftau_file", 1).add("degree", 1);
78 }

Member Function Documentation

◆ parse()

void cli_options::parse ( int  argc,
char **  argv 
)

Definition at line 88 of file pot_process.cpp.

89 {
90  po::variables_map vm;
91  po::parsed_options parsed = po::command_line_parser(argc, argv)
92  .options(all_desc)
93  .positional(pos)
94  .run();
95  po::store(parsed, vm);
96 
97  command = argv[0];
98 
99  if (vm.count("help")) {
100  help = true;
101  return;
102  }
103 
104  if (0 == vm.count("powersoftau_file")) {
105  throw po::error("powersoftau_file not specified");
106  }
107  if (0 == vm.count("degree")) {
108  throw po::error("degree not specified");
109  }
110 
111  powersoftau_file = vm["powersoftau_file"].as<std::string>();
112  verbose = vm.count("verbose");
113  check = vm.count("check");
114  degree = vm["degree"].as<size_t>();
115  lagrange_degree = vm.count("lagrange-degree")
116  ? vm["lagrange-degree"].as<size_t>()
117  : degree;
118  out = vm.count("out") ? vm["out"].as<std::string>()
119  : "lagrange-" + std::to_string(lagrange_degree);
120  dummy = vm.count("dummy");
121 
122  if (dummy && check) {
123  throw po::error("specify at most one of --dummy and --check");
124  }
125 }
Here is the caller graph for this function:

◆ usage()

void cli_options::usage ( ) const

Definition at line 80 of file pot_process.cpp.

81 {
82  std::cout << "Usage:" << std::endl
83  << " " << command
84  << " [<options>] <powersoftau file> <degree>\n\n"
85  << desc << std::endl;
86 }
Here is the caller graph for this function:

Member Data Documentation

◆ all_desc

po::options_description cli_options::all_desc

Definition at line 37 of file pot_process.cpp.

◆ check

bool cli_options::check

Definition at line 45 of file pot_process.cpp.

◆ command

std::string cli_options::command

Definition at line 40 of file pot_process.cpp.

◆ degree

size_t cli_options::degree

Definition at line 43 of file pot_process.cpp.

◆ desc

po::options_description cli_options::desc

Definition at line 36 of file pot_process.cpp.

◆ dummy

bool cli_options::dummy

Definition at line 46 of file pot_process.cpp.

◆ help

bool cli_options::help

Definition at line 41 of file pot_process.cpp.

◆ lagrange_degree

size_t cli_options::lagrange_degree

Definition at line 48 of file pot_process.cpp.

◆ out

std::string cli_options::out

Definition at line 47 of file pot_process.cpp.

◆ pos

po::positional_options_description cli_options::pos

Definition at line 38 of file pot_process.cpp.

◆ powersoftau_file

std::string cli_options::powersoftau_file

Definition at line 42 of file pot_process.cpp.

◆ verbose

bool cli_options::verbose

Definition at line 44 of file pot_process.cpp.


The documentation for this class was generated from the following file:
cli_options::pos
po::positional_options_description pos
Definition: pot_process.cpp:38
cli_options::powersoftau_file
std::string powersoftau_file
Definition: pot_process.cpp:42
cli_options::desc
po::options_description desc
Definition: pot_process.cpp:36
cli_options::verbose
bool verbose
Definition: pot_process.cpp:44
cli_options::dummy
bool dummy
Definition: pot_process.cpp:46
cli_options::help
bool help
Definition: pot_process.cpp:41
cli_options::check
bool check
Definition: pot_process.cpp:45
cli_options::lagrange_degree
size_t lagrange_degree
Definition: pot_process.cpp:48
cli_options::command
std::string command
Definition: pot_process.cpp:40
cli_options::degree
size_t degree
Definition: pot_process.cpp:43
cli_options::all_desc
po::options_description all_desc
Definition: pot_process.cpp:37
cli_options::out
std::string out
Definition: pot_process.cpp:47