Open Gankra opened 9 months ago
Ideally this separate binary would have the optional ability to just take in a process exit code number and use that directly, its possible already using CARGO_MOMMYS_ACTUAL=bash cargo-mommy -c "exit $?"
in a zsh precmd hook to integrate it with my shell, but it feels like quite a hack, it'd be nice if i could just pass cargo mommy the $?
exit code directly and have it react on that, since then there isnt the overhead of spinning up bash and running exit
and all
That's how FWDekker/mommy does it, and that works quite well especially for shell integration.
Many people have asked, it might be reasonable to have the cargo-mommy package include two binaries:
cargo-mommy
(the current one) andmommy
(a new one). Themommy
binary would behave more liketime
or whatever, in that it would execute all the arguments that follow, without any notion of "re-invoking cargo".cargo mommy check
would be basically equivalent tomommy cargo check
, i think.If we want to do this, the bulk of
main.rs
should be hoisted into a newlib.rs
, as both binaries would share most logic.They would basically differ in the cli logic in main.rs:
https://github.com/Gankra/cargo-mommy/blob/0ec17361d8b0573d0155984403e576b788abeb60/src/main.rs#L45-L168