Skip to content

Commit

Permalink
Respecting the --ns option in zimdump show
Browse files Browse the repository at this point in the history
  • Loading branch information
veloman-yunkan authored and kelson42 committed Nov 25, 2023
1 parent 8d143f4 commit 9617b27
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/zimdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@ int subcmdShow(ZimDumper &app, std::map<std::string, docopt::value> &args)
if (args["--idx"]) {
return app.dumpEntry(app.getEntry(args["--idx"].asLong()));
} else {
return app.dumpEntry(app.getEntryByPath(args["--url"].asString()));
std::string entryPath = args["--url"].asString();
if ( args["--ns"] ) {
entryPath = args["--ns"].asString() + "/" + entryPath;
}
return app.dumpEntry(app.getEntryByPath(entryPath));
}
} catch(...) {
std::cerr << "Entry not found" << std::endl;
Expand Down

0 comments on commit 9617b27

Please sign in to comment.