kiwix / kiwix-tools

Command line Kiwix tools: kiwix-serve, kiwix-manage, ...
https://download.kiwix.org/release/kiwix-tools/
GNU General Public License v3.0
461 stars 87 forks source link

added --customIndexTemplate option #477

Closed MananJethwani closed 3 years ago

MananJethwani commented 3 years ago

@kelson42 this PR will add --customIndexTemplate argument.

This depends on https://github.com/kiwix/libkiwix/pull/607

MananJethwani commented 3 years ago

@kelson42 sorry, it wasn't working when I used -c it was working with --c, my bad.

MananJethwani commented 3 years ago

@kelson42 the error for the non-readable file should be propagated by kiwix::getFileContent() in libkiwix/tools.h, so I couldn't do much but I am showing a warning if unreadable or empty template file is passed. I have added errors for all other cases and exiting the code.

kelson42 commented 3 years ago

@MananJethwani I don't know the code detail, but it should stop, not display a warning. Probably kiwix::getFileContent() should trigger an exception and you should catch it.

mgautierfr commented 3 years ago

Agree with @kelson42 if the user pass a option and we cannot respect it, it should be a error.