mirror of
https://github.com/kiwix/kiwix-tools.git
synced 2025-09-22 19:38:53 -04:00
Merge pull request #364 from kiwix/fix-argument-parsing
Fix argument parsing
This commit is contained in:
commit
b65212fab7
@ -1,3 +1,8 @@
|
|||||||
|
kiwix-tools 3.0.3
|
||||||
|
=================
|
||||||
|
|
||||||
|
* [MANAGER] Fix broken --version argument parsin
|
||||||
|
|
||||||
kiwix-tools 3.0.2
|
kiwix-tools 3.0.2
|
||||||
=================
|
=================
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
|
|||||||
string zimPath;
|
string zimPath;
|
||||||
string zimPathToSave = ".";
|
string zimPathToSave = ".";
|
||||||
string url;
|
string url;
|
||||||
string origID = "";
|
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int c = 0;
|
int c = 0;
|
||||||
int resultCode = 0;
|
int resultCode = 0;
|
||||||
@ -133,7 +132,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
|
|||||||
optind = 3;
|
optind = 3;
|
||||||
static struct option long_options[] = {
|
static struct option long_options[] = {
|
||||||
{"url", required_argument, 0, 'u'},
|
{"url", required_argument, 0, 'u'},
|
||||||
{"origId", required_argument, 0, 'o'},
|
|
||||||
{"zimPathToSave", required_argument, 0, 'z'},
|
{"zimPathToSave", required_argument, 0, 'z'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
@ -149,9 +147,6 @@ int handle_add(kiwix::Library* library, const std::string& libraryPath,
|
|||||||
case 'u':
|
case 'u':
|
||||||
url = optarg;
|
url = optarg;
|
||||||
break;
|
break;
|
||||||
case 'o':
|
|
||||||
origID = optarg;
|
|
||||||
break;
|
|
||||||
case 'z':
|
case 'z':
|
||||||
zimPathToSave = optarg;
|
zimPathToSave = optarg;
|
||||||
break;
|
break;
|
||||||
@ -228,7 +223,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
int c;
|
int c;
|
||||||
while (true) {
|
while (true && argc == 2) {
|
||||||
c = getopt_long(argc, argv, "v", long_options, &option_index);
|
c = getopt_long(argc, argv, "v", long_options, &option_index);
|
||||||
if (c == -1)
|
if (c == -1)
|
||||||
break;
|
break;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user