Commit graph

105 commits

Author SHA1 Message Date
0c0a5cab70 esv: handle thrown CurlExceptions 2024-06-26 13:47:48 +12:00
0b3626b36c esvapi: expose CurlException 2024-06-26 13:47:48 +12:00
e713ff9ddf makefile: fix man page installation 2024-06-26 13:47:48 +12:00
11543da52f esv: handle absence of search results with -s
previously this would throw an unhandled ESVException.
2024-06-26 13:47:48 +12:00
de08bf5c70 esv.1: revise manual
Reword much of the manual, add the -s option, and add AUTHORS and BUGS
sections among other small changes.
2024-06-26 13:47:48 +12:00
024e612dab move to sourcehut 2024-06-26 13:47:48 +12:00
f1b79c2a7c refactor configure script
Generate a makefile config instead of a makefile with predefined
constants. This makes the build a bit more easier to modify. Also
improve the makefile and apply some suggestions from shellcheck. :)
2024-06-26 13:47:48 +12:00
4bb8d391fd initialise sourcehut CI
esv is now built and briefly tested on Arch Linux and OpenBSD.
2024-06-26 13:47:48 +12:00
5a9103bfa8 mark development version 2024-06-26 13:47:48 +12:00
467573c99a reword version 2024-06-26 13:47:48 +12:00
0752c9db7c style fixes
o  fix doc comment style: use /++ rather than /**
    just to make it a bit more clear
 o  remove trailing whitespace
 o  remove unnecessary whitespace
 o  use => style for @property functions
 o  more fixes
2024-06-26 13:47:48 +12:00
8881e20178 update readme 2024-06-26 13:47:48 +12:00
49e2606a2e improve error message system
Move away from the exception-based system where we throw an Exception
to stop the program (which is caught by main) and use a new die
function that accesses args[0], prints an error and stops the program.
Users should not notice a difference, I think this system is more
lightweight and requires less code.
2024-06-26 13:47:48 +12:00
87826cba0d add nix flake 2024-06-26 13:47:48 +12:00
566ec45337 fix install target of makefile 2024-06-26 13:47:48 +12:00
8b392c5bab use @safe everywhere
with a little bit of evil @trusted magic...
2024-06-26 13:47:48 +12:00
2e93c891fd migrate to initial.d over dini
initial.d is my very own INI parser, see
  <https://git.sr.ht/~jeremy/initial>
2024-06-26 13:47:48 +12:00
de9e18f06e update copyright year to 2024 2024-06-26 13:47:48 +12:00
9311b19f6d update manual 2024-06-26 13:47:48 +12:00
aecbdfec4f Add call to pledge() on OpenBSD 2024-06-26 13:47:48 +12:00
1c9bb056e8 Remove automatic pager functionality 2024-06-26 13:47:48 +12:00
35a880ae26 Fix build on OpenBSD 2024-06-26 13:47:48 +12:00
775dc924a5 Add bounds check to build and fix editorconfig 2024-06-26 13:47:48 +12:00
c5c9930a55 Fix weird indentation bug
...by setting the default indentation character to a space.
2024-06-26 13:47:48 +12:00
97c9c427ff Add @safe and final where possible, remove unnecessary documentation and fix incorrect indentation 2024-06-26 13:47:48 +12:00
472261e15a Document everything and fix out-of-bounds memory error 2024-06-26 13:47:48 +12:00
60023c259e Add editorconfig 2024-06-26 13:47:48 +12:00
12d5d9dcea Add search functionality and make other improvements 2024-06-26 13:47:48 +12:00
6e71909c6e Improve configure script 2024-06-26 13:47:48 +12:00
ca36b7fb90 OpenBSD code style 2024-06-26 13:47:48 +12:00
c21ab033ee Add module statement to esv.d 2024-06-26 13:47:48 +12:00
6efe117545 Switch to configure and make based build
Also removed excessive use of std.regex in esvapi.d and
made it actually compile -_-
2024-06-26 13:47:48 +12:00
7ebc0d7b66 Rename main.d -> esv.d 2024-06-26 13:47:48 +12:00
06a4dc286d 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
2024-06-26 13:47:48 +12:00
1b11097ba0 Reorder method attributes and add pure attribute to some methods 2024-06-26 13:47:48 +12:00
8564fd3003 Heavily refactor esvapi.d (add ESVMode enum, ...) and apply changes to main.d 2024-06-26 13:47:48 +12:00
45890a6051 esv.d -> esvapi.d 2024-06-26 13:47:48 +12:00
d3558feb35 Readme changes 2024-06-26 13:47:48 +12:00
0285e0979d More makefile changes 2024-06-26 13:47:48 +12:00
5dc2a12f1e Refactor config parsing code in main.d, rename esv.d -> esvapi.d, rename class EsvAPI to ESVApi, makefile changes 2024-06-26 13:47:48 +12:00
7f61d7bfa6 Rename ESVAPI_BIBLE_BOOKS to BIBLE_BOOKS and make it use spaces for book names, instead of underscores. 2024-06-26 13:47:48 +12:00
64fca717c6 Reduce repetition in Makefile 2024-06-26 13:47:48 +12:00
7d96227dc2 Remove 'this' in front of every member variable in the EsvAPI class, and correct function parameter definitions 2024-06-26 13:47:48 +12:00
56d69af099 Add @safe attribute to main.extractOpt() 2024-06-26 13:47:48 +12:00
6a6f39e0bd Remove gmake-exclusive ifeq statements in Makefile 2024-06-26 13:47:39 +12:00
dddf0db33f Add in, @nogc and @safe attributes to functions and parameters 2023-05-11 13:25:08 +12:00
f2e056bf06 License everything under the GPL version 2 2023-03-28 10:44:58 +13:00
fc93266113 Use a default approved API key and update to 0.2.0 2023-03-27 13:58:05 +13:00
0147fe1c60 Add support for changing the MP3 audio player through the ESV_PLAYER environment variable 2023-03-27 13:32:18 +13:00
3751040fe0 Use environment.get()'s second default value argument instead of using null checks 2023-03-27 13:08:04 +13:00