mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-07-04 12:03:41 +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")) {
|
if (!strcmp(argv[p], "search")) {
|
||||||
bool parse_opt;
|
|
||||||
p++;
|
|
||||||
|
|
||||||
do {
|
while(p++ < argc) {
|
||||||
parse_opt = false;
|
if (!strcmp(argv[p], "--l33t")) {
|
||||||
|
|
||||||
if (p < argc && !strcmp(argv[p], "--l33t")) {
|
|
||||||
option_l33t = true;
|
option_l33t = true;
|
||||||
parse_opt = true;
|
} else if (!memcmp(argv[p], "--threads=", 10)) {
|
||||||
p++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (p < argc && !memcmp(argv[p], "--threads=", 10)) {
|
|
||||||
#ifdef HAVE_THREADS
|
#ifdef HAVE_THREADS
|
||||||
option_num_threads = atoi(argv[p] + 10);
|
option_num_threads = atoi(argv[p] + 10);
|
||||||
if (option_num_threads < 2) {
|
if (option_num_threads < 2) {
|
||||||
|
|
@ -173,10 +165,12 @@ int main(int argc, char **argv) {
|
||||||
std::cerr << "NOTICE: eosio-keygen is not compiled with"
|
std::cerr << "NOTICE: eosio-keygen is not compiled with"
|
||||||
<< " thread support. this option is ignored." << std::endl;
|
<< " thread support. this option is ignored." << std::endl;
|
||||||
#endif /* HAVE_THREADS */
|
#endif /* HAVE_THREADS */
|
||||||
p++;
|
|
||||||
parse_opt = true;
|
|
||||||
}
|
}
|
||||||
} while(parse_opt && p < argc);
|
// Nothing to parse
|
||||||
|
else {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (argc <= p) {
|
if (argc <= p) {
|
||||||
std::cerr << "You must specify a word list." << std::endl;
|
std::cerr << "You must specify a word list." << std::endl;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue