On Sun, Jan 07, 2024 at 06:36:33PM -0700, Thomas Bertschinger wrote:
> The bcachefs sub-commands that are implemented in Rust (completions,
> list, and mount) had separate entrypoints and thus had some differences
> in behavior.
> 
> This introduces a common entry point for the Rust sub-commands. This
> reduces duplicate boilerplate code like parsing argv and setting up
> logging, and will facilitate converting more sub-commands to Rust in
> the future.
> 
> An immediate benefit is that this fixes an issue with `bcachefs list`
> not reporting errors:
> 
> before:
> 
> $ bcachefs list /dev/typo
> $ echo $?
> 0
> 
> after:
> 
> $ bcachefs list /dev/typo
> ERROR - bcachefs_rust::cmd_list: Fatal error: "No such file or directory"
> $ echo $?
> 1

Applying this

If you feel like going the extra mile, maybe we could convert the top
level main() to Rust, that'd further improve our helptext...

Reply via email to