Hey everyone π!
We are back once again for a release π! In 0.0.6 we have directed our attention in heavily overhauling the ergonomics of shrs. The most awesome improvement is the introduction of dependency injection to most of the API, including hooks, builtins, keybindings, prompt, and more. What this means for you is that instead of passing around a bunch of state structs, you can now query for exactly what state you need! See how this heavily simplifies your code below.
This first example shows the difference when writing a prompt. You no longer need to reach into line_ctx.ctx.state
and query for the specific state yourself. Just put desired state in the argument list and you get it right away! No more error handling either!
Similarly, see how writing builtins have become a breeze, with much less noise in the argument noise and no longer requiring implementing a Builtin
trait.
Finally, we have done a bunch of work on overhauling the docs with much more descriptive docstrings and code examples in each module! We hope this release has made writing your own shell using shrs that much more delightful.
See you around π«‘
- pinosaur
What's Changed
- DI Shell rework by @nithinmuthukumar in #442
- Refactor command timer by @MrPicklePinosaur in #443
- Refactor mux plugin to use dependency injection by @MrPicklePinosaur in #444
- Nithin/keybinding di by @nithinmuthukumar in #445
- Porting rest of builtins by @nithinmuthukumar in #446
- Nithin/history move by @nithinmuthukumar in #453
- Update example to use FileBackedHistoryPlugin by @morbidbark in #456
- Nithin/hooks in core by @nithinmuthukumar in #454
- Fix example compilation issues by @nithinmuthukumar in #457
- Fix AutocdPlugin by @morbidbark in #458
- remove errors in example bins by @nithinmuthukumar in #459
- Option param by @nithinmuthukumar in #461
- Nithin/state docs by @nithinmuthukumar in #462
- Nithin/docs by @nithinmuthukumar in #467
- Nithin/import refactor by @nithinmuthukumar in #468
- readline docs by @nithinmuthukumar in #469
New Contributors
- @morbidbark made their first contribution in #456
Full Changelog: 0.0.5...0.0.6