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 Dec 4, 2022
1 parent cec619c commit f8f971a
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 @@ -412,7 +412,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 f8f971a

Please sign in to comment.