Skip to content

Commit

Permalink
make --help and --version work withoud providing -e flag #494
Browse files Browse the repository at this point in the history
  • Loading branch information
CblPOK-git authored and makxenov committed Jan 16, 2024
1 parent ab7f577 commit 8f205d3
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions bin/transpiler/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,22 @@ int main(int argc, char *argv[]) {
vm);
boost::program_options::notify(vm);

if (vm.count("help")) {
std::cout << options_desc << std::endl;
return 0;
}

if (vm.count("version")) {
#ifdef TRANSPILER_VERSION
#define xstr(s) str(s)
#define str(s) #s
std::cout << xstr(TRANSPILER_VERSION) << std::endl;
#else
std::cout << "Version is not defined" << std::endl;
#endif
return 0;
}

std::string elliptic_curve;

if (vm.count("elliptic-curve-type")) {
Expand Down Expand Up @@ -220,22 +236,6 @@ int curve_dependent_main(
boost::program_options::variables_map vm
) {

if (vm.count("help")) {
std::cout << options_desc << std::endl;
return 0;
}

if (vm.count("version")) {
#ifdef TRANSPILER_VERSION
#define xstr(s) str(s)
#define str(s) #s
std::cout << xstr(TRANSPILER_VERSION) << std::endl;
#else
std::cout << "undefined" << std::endl;
#endif
return 0;
}

std::string mode;
std::string assignment_table_file_name;
std::string circuit_file_name;
Expand Down

0 comments on commit 8f205d3

Please sign in to comment.