mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-17 03:50:03 +02:00
src/main.cpp: refactor the do/while loop for search flags into just a while loop.
This commit is contained in:
parent
cb5df9bbba
commit
f9930ec4fc
1 changed files with 8 additions and 14 deletions
22
src/main.cpp
22
src/main.cpp
|
|
@ -147,19 +147,11 @@ int main(int argc, char **argv) {
|
|||
}
|
||||
|
||||
if (!strcmp(argv[p], "search")) {
|
||||
bool parse_opt;
|
||||
p++;
|
||||
|
||||
do {
|
||||
parse_opt = false;
|
||||
|
||||
if (p < argc && !strcmp(argv[p], "--l33t")) {
|
||||
while(p++ < argc) {
|
||||
if (!strcmp(argv[p], "--l33t")) {
|
||||
option_l33t = true;
|
||||
parse_opt = true;
|
||||
p++;
|
||||
}
|
||||
|
||||
if (p < argc && !memcmp(argv[p], "--threads=", 10)) {
|
||||
} else if (!memcmp(argv[p], "--threads=", 10)) {
|
||||
#ifdef HAVE_THREADS
|
||||
option_num_threads = atoi(argv[p] + 10);
|
||||
if (option_num_threads < 2) {
|
||||
|
|
@ -173,10 +165,12 @@ int main(int argc, char **argv) {
|
|||
std::cerr << "NOTICE: eosio-keygen is not compiled with"
|
||||
<< " thread support. this option is ignored." << std::endl;
|
||||
#endif /* HAVE_THREADS */
|
||||
p++;
|
||||
parse_opt = true;
|
||||
}
|
||||
} while(parse_opt && p < argc);
|
||||
// Nothing to parse
|
||||
else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (argc <= p) {
|
||||
std::cerr << "You must specify a word list." << std::endl;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue