bcachefs-tools/rust-src/src
Thomas Bertschinger 9a9af6e9e6 create common entry point for Rust commands
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

Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
2024-01-07 21:38:31 -05:00
..
cmd_completions.rs create common entry point for Rust commands 2024-01-07 21:38:31 -05:00
cmd_list.rs create common entry point for Rust commands 2024-01-07 21:38:31 -05:00
cmd_main.rs create common entry point for Rust commands 2024-01-07 21:38:31 -05:00
cmd_mount.rs create common entry point for Rust commands 2024-01-07 21:38:31 -05:00
key.rs rust keylocation add none variant and implement ValueEnum 2023-11-12 11:14:16 -05:00
lib.rs create common entry point for Rust commands 2024-01-07 21:38:31 -05:00
logger.rs chore: logger for idiomatic style and expanded logging levels 2023-04-26 17:46:23 -04:00