Hello Everyone, I'm new here and quite new to rust. Recently I "finished" my first library project in rust and I'd like to advertise it here and I'd also like to hear your opinions on it. Is it useful, or is it a bad idea or maybe superfluous?
To the actual thing: As the title says, it's an alternative way (to e.g. clap) to build a cli with subcommands. Basically You write a rust module / function structure, where each module and function represents a (sub)command (the functions are here just the executable subcommands). It removes some of the boilderplate of clap, d.i. You do no longer have to write the whole structs, enum and match-arm structure. The delegation to the functions is done automatically. That's it pretty ...
Hello Everyone, I'm new here and quite new to rust. Recently I "finished" my first library project in rust and I'd like to advertise it here and I'd also like to hear your opinions on it. Is it useful, or is it a bad idea or maybe superfluous?
To the actual thing: As the title says, it's an alternative way (to e.g. clap) to build a cli with subcommands. Basically You write a rust module / function structure, where each module and function represents a (sub)command (the functions are here just the executable subcommands). It removes some of the boilderplate of clap, d.i. You do no longer have to write the whole structs, enum and match-arm structure. The delegation to the functions is done automatically. That's it pretty much.
Since it is build on clap, it inherits many of it's features and everyone having worked with it should already know how to annotate the functions arguments, such that it produces the desired cli parameters.
The downside is, that it relies quite heavily on code parsing and code generation using a macro. I tried to propagate errors correclty, but no software is without bugs and bugs in macros tend to be nasty. So understandably it might not be to everyones liking.
My original motivation was to build something like ruby rake or python invoke, but with the premise, that the compile executable is runnable on most systems I deploy my projects on. But after the first iteration I was not quite satisfied with the result and actually rebuild it completly XD.
I named the project tusks (because originally I had something like short build "tasks" in mind). You can of course check it out at crates.io: