Refactor most of the code

- Replace panic()-based error handling in main() with
   Exception-based error handling
 - Put hardcoded defaults in config.di
 - Make general optimisations and readability improvements
   for a lot of the code
 - Change some of the ESVApi's interface
This commit is contained in:
Jeremy Baxter 2023-09-23 17:10:38 +12:00
parent 1b11097ba0
commit 06a4dc286d
3 changed files with 397 additions and 362 deletions

18
config.di Normal file
View file

@ -0,0 +1,18 @@
/* default configuration for esv */
module config;
public:
enum DEFAULT_APIKEY = "abfb7456fa52ec4292c79e435890cfa3df14dc2b";
enum DEFAULT_CONFIGPATH = "~/.config/esv.conf";
enum DEFAULT_MPEGPLAYER = "mpg123";
enum DEFAULT_PAGER = "less";
enum ENV_CONFIG = "ESV_CONFIG";
enum ENV_PAGER = "ESV_PAGER";
enum ENV_PLAYER = "ESV_PLAYER";
enum BUGREPORTURL = "https://codeberg.org/jtbx/esv/issues";
// vi: ft=d