Full rewrite #24

Open
emma wants to merge 30 commits from rewrite into main

30 Commits

Author SHA1 Message Date
Emma Tebibyte 49691bd68c
updated main() 2023-04-19 01:03:28 -04:00
Emma Tebibyte 570adfc17d
more changes to error types 2023-03-28 18:27:22 -04:00
Emma Tebibyte 8448097387
main.rs: minor change to subcommand matching 2023-03-27 00:54:00 -04:00
Emma Tebibyte 34993ceb13
main.rs: changed command match err output to HopError 2023-03-27 00:44:35 -04:00
Emma Tebibyte 7eb530c9b0
main.rs: fixed license header 2023-03-27 00:32:59 -04:00
Emma Tebibyte ba726358b4
args.rs: implemented From<PackageParseError> for (String, u32) 2023-03-27 00:32:27 -04:00
Emma Tebibyte 875290a75c
config.rs: Removed HopError From trait from ConfigError and refactored 2023-03-27 00:13:39 -04:00
Emma Tebibyte 3eedea2f9c
updated error types 2023-03-27 00:01:32 -04:00
Emma Tebibyte 623d65be0d
added .editorconfig file 2023-03-26 19:08:28 -04:00
[ ] 80fbbebc91
update copyright 2023-03-26 11:56:44 +01:00
[ ] 3eac2d2eab
create custom CError trait, using it for errors
The name chosen here is perhaps not ideal, and if you can think of a
better one that should probably be quickly used instead.

This is one option for C exit-code handling which is a lot cleaner than
the existing implementation in my opinion. Much of the cleanup also
comes from the enum error type in config. This enum's implementation
could be a lot cleaner with something like the 'thiserror' crate: the
message method could simply utilize that crate's derived Display
implementation.

Regarding `unwrap_or_else(|e| e.exit())`, it would have been ideal to
simply handle panics with a handler so it could simply be `unwrap()`,
but since panics tend to only pass the error string to the handler, an
exit method seems like the best solution.

Because this enforces consistency of adding the program invokation
before every error message, it has an unfortunate side-effect of the
usage text getting that information duplicated which may be seen as
undesirable. There are some workarounds to this, but I've deferred
deciding how best to do that (if it even is desirable to do so).
2023-03-26 11:44:52 +01:00
Emma Tebibyte a0453f1cc3
updated deps 2023-03-25 19:21:15 -04:00
Emma Tebibyte c2f6af517c
main.rs: minor tweaks 2023-03-25 06:41:14 -04:00
Emma Tebibyte 0f1561e0c4
args.rs, client.rs: changed to reflect changes to usage text 2023-03-25 06:11:43 -04:00
Emma Tebibyte b01064e615
updated usage text 2023-03-25 05:58:45 -04:00
Emma Tebibyte 53bd5ce4b3
made usage info, fixed configuration parsing, and made a better error for unimplemented subcommands 2023-03-25 05:03:27 -04:00
Emma Tebibyte 261b40cc0b
client.rs: changed PackageType parsing to fix compilation and removed reqwest-based code; main.rs, args.rs: cleanup 2023-03-24 14:50:10 -04:00
Emma Tebibyte 8d0b82149d
oops! 2023-03-23 02:29:48 -04:00
Emma Tebibyte 7b7207b6ba
more pieces from #22 2023-03-23 01:40:49 -04:00
Emma Tebibyte 5f92afb375
changed config file name 2023-03-23 01:35:01 -04:00
Emma Tebibyte c946310e27
updated README 2023-03-23 01:13:28 -04:00
Emma Tebibyte 3aeae3886a
added [ ] to authors list in Cargo.toml 2023-03-23 00:39:07 -04:00
Emma Tebibyte 5274597ce0
added commands.rs 2023-03-23 00:19:02 -04:00
Emma Tebibyte 8a0315822e
fixed copyright headers, rewrote most of the original code 2023-03-23 00:18:42 -04:00
Emma Tebibyte 70b2bb72be
added contribution guidelines 2023-03-23 00:17:33 -04:00
Emma Tebibyte a22bcde459
added hopfile.rs from #22 2023-03-22 23:43:53 -04:00
Emma Tebibyte ffc028adff
oops 2023-03-22 19:50:18 -04:00
Emma Tebibyte 31db7e6fea
license header update 2023-03-22 18:56:07 -04:00
Emma Tebibyte 04a7f27dea
oops forgot to make those pub 2023-03-22 18:42:20 -04:00
Emma Tebibyte 6dd9c4871d
arg types implemented 2023-03-22 18:25:31 -04:00