Skip to content

Commit

Permalink
drop Malva CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
g-plane committed May 11, 2024
1 parent a0a7c39 commit b9ba9b3
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 568 deletions.
361 changes: 4 additions & 357 deletions Cargo.lock

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ members = [
"benchmark",
"dprint_plugin",
"malva",
"malva_cli",
"standalone_wasm",
]
resolver = "2"
Expand Down
22 changes: 22 additions & 0 deletions malva/examples/fmt.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use malva::{config::FormatOptions, detect_syntax, format_text};
use std::{env, error::Error, fs, io};

fn main() -> Result<(), Box<dyn Error>> {
let file_path = env::args().nth(1).unwrap();
let syntax = detect_syntax(&file_path).unwrap();
let input = fs::read_to_string(&file_path)?;
let options = match fs::read_to_string("malva.toml") {
Ok(s) => toml::from_str(&s)?,
Err(error) => {
if error.kind() == io::ErrorKind::NotFound {
FormatOptions::default()
} else {
return Err(Box::new(error));
}
}
};

let formatted = format_text(&input, syntax, &options)?;
print!("{formatted}");
Ok(())
}
30 changes: 0 additions & 30 deletions malva_cli/Cargo.toml

This file was deleted.

26 changes: 0 additions & 26 deletions malva_cli/src/config.rs

This file was deleted.

20 changes: 0 additions & 20 deletions malva_cli/src/format.rs

This file was deleted.

75 changes: 0 additions & 75 deletions malva_cli/src/main.rs

This file was deleted.

59 changes: 0 additions & 59 deletions malva_cli/src/search.rs

This file was deleted.

0 comments on commit b9ba9b3

Please sign in to comment.