mirror of
https://github.com/eosswedenorg/antelope-keygen
synced 2026-06-16 03:44:56 +02:00
src/main.cpp: in command line parsing for search, move word list and count inside while loop.
This commit is contained in:
parent
b24ea1fc83
commit
fca45626fa
1 changed files with 16 additions and 16 deletions
32
src/main.cpp
32
src/main.cpp
|
|
@ -138,6 +138,9 @@ int main(int argc, char **argv) {
|
|||
|
||||
if (!strcmp(argv[p], "search")) {
|
||||
|
||||
int count = 10;
|
||||
strlist_t words;
|
||||
|
||||
while(p++ < argc - 1) {
|
||||
if (!strcmp(argv[p], "--l33t")) {
|
||||
option_l33t = true;
|
||||
|
|
@ -162,29 +165,26 @@ int main(int argc, char **argv) {
|
|||
usage(argv[0]);
|
||||
return 0;
|
||||
}
|
||||
// Nothing to parse
|
||||
else {
|
||||
break;
|
||||
// wordlist and count
|
||||
else if (words.size() < 1) {
|
||||
words = strsplitwords(std::string(argv[p]));
|
||||
|
||||
if (p + 1 < argc) {
|
||||
count = atoi(argv[++p]);
|
||||
if (count < 1) {
|
||||
count = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (argc <= p) {
|
||||
if (words.size() < 1) {
|
||||
std::cerr << "You must specify a word list." << std::endl;
|
||||
usage(argv[0]);
|
||||
return 1;
|
||||
} else {
|
||||
int count = 10;
|
||||
strlist_t words = strsplitwords(std::string(argv[p]));
|
||||
|
||||
if (p + 1 < argc) {
|
||||
count = atoi(argv[p+1]);
|
||||
if (count < 1) {
|
||||
count = 1;
|
||||
}
|
||||
}
|
||||
|
||||
cmd_search(words, count);
|
||||
}
|
||||
|
||||
cmd_search(words, count);
|
||||
}
|
||||
// Benchmark
|
||||
else if (!strcmp(argv[p], "benchmark")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue