ktrs_cli/ktfmt/mod.rs
1//! Port of ktfmt's `cli` package (v0.64): the `ktfmt` binary's flags, messages and exit codes.
2
3pub use ktrs_fmt::editor_config_resolver;
4pub mod main;
5pub mod parsed_args;
6
7pub use main::{Main, expand_args_to_file_names};
8pub use parsed_args::{HELP_TEXT, KTFMT_VERSION, ParseResult, ParsedArgs, parse_options, process_args};
9
10/// The `ktfmt` binary: `args` without the program name; returns the exit code.
11pub fn main(args: &[String]) -> i32 {
12 ktrs_syntax::caught_panic::silence_caught_panics();
13 Main::new(std::io::stdin(), std::io::stdout(), std::io::stderr()).run(args)
14}