Minor fixes in command line tool.
This commit is contained in:
parent
f5c937d1fc
commit
6744476198
@ -35,7 +35,7 @@ int main(int argc, char** argv) {
|
|||||||
|
|
||||||
int verbosity = 0;
|
int verbosity = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
char ch = (char)getopt(argc, argv, "hv");
|
char ch = (char)getopt(argc, argv, "hvV");
|
||||||
if (ch == -1) break;
|
if (ch == -1) break;
|
||||||
switch (ch) {
|
switch (ch) {
|
||||||
case 'h':
|
case 'h':
|
||||||
@ -55,6 +55,10 @@ int main(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
vector<string> keys;
|
vector<string> keys;
|
||||||
ifstream f(argv[optind]);
|
ifstream f(argv[optind]);
|
||||||
|
if (!f.is_open()) {
|
||||||
|
std::cerr << "Failed to open " << argv[optind] << std::endl;
|
||||||
|
exit(-1);
|
||||||
|
}
|
||||||
string buffer;
|
string buffer;
|
||||||
while (!getline(f, buffer).eof()) keys.push_back(buffer);
|
while (!getline(f, buffer).eof()) keys.push_back(buffer);
|
||||||
for (uint32_t i = 0; i < keys.size(); ++i) string s = keys[i];
|
for (uint32_t i = 0; i < keys.size(); ++i) string s = keys[i];
|
||||||
|
Loading…
Reference in New Issue
Block a user