summaryrefslogtreecommitdiff
path: root/rust-src/src/cmd_list.rs
diff options
context:
space:
mode:
authorThomas Bertschinger <tahbertschinger@gmail.com>2024-01-15 23:41:00 -0700
committerKent Overstreet <kent.overstreet@linux.dev>2024-01-16 01:46:41 -0500
commit0a284fc4ffcbb46f0a4b921415ef12a9c75fa05c (patch)
tree22aa82b7448833713ca975eb3c241f607742fc78 /rust-src/src/cmd_list.rs
parent249bf7b9d446092e1b744c366b7e8c4563a437f0 (diff)
convert main() from C to Rust
This moves the main() function from C to Rust. It also updates the name of the Rust package from "bcachefs-rust" to "bcachefs-tools". Signed-off-by: Thomas Bertschinger <tahbertschinger@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'rust-src/src/cmd_list.rs')
-rw-r--r--rust-src/src/cmd_list.rs3
1 files changed, 1 insertions, 2 deletions
diff --git a/rust-src/src/cmd_list.rs b/rust-src/src/cmd_list.rs
index fa9c2f2f..cb352916 100644
--- a/rust-src/src/cmd_list.rs
+++ b/rust-src/src/cmd_list.rs
@@ -9,7 +9,6 @@ use bch_bindgen::btree::BtreeIter;
use bch_bindgen::btree::BtreeNodeIter;
use bch_bindgen::btree::BtreeIterFlags;
use clap::{Parser};
-use std::ffi::{c_int, OsStr};
fn list_keys(fs: &Fs, opt: Cli) -> anyhow::Result<()> {
let trans = BtreeTrans::new(fs);
@@ -157,7 +156,7 @@ fn cmd_list_inner(opt: Cli) -> anyhow::Result<()> {
}
}
-pub fn cmd_list(argv: Vec<&OsStr>) -> c_int {
+pub fn cmd_list(argv: Vec<String>) -> i32 {
let opt = Cli::parse_from(argv);
colored::control::set_override(opt.colorize);
if let Err(e) = cmd_list_inner(opt) {