Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions apps/oxfmt/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,15 @@ const PATHS_ERROR_MESSAGE: &str = "PATH must not contain \"..\"";
pub struct FormatCommand {
#[bpaf(external, fallback(OutputOptions::DefaultWrite))]
pub output_options: OutputOptions,

#[bpaf(external)]
pub basic_options: BasicOptions,

#[bpaf(external)]
pub ignore_options: IgnoreOptions,

#[bpaf(external)]
pub misc_options: MiscOptions,

/// Single file, single path or list of paths.
/// If not provided, current working directory is used.
/// Glob is supported only for exclude patterns like `'!**/fixtures/*.js'.
// `bpaf(fallback)` seems to have issues with `many` or `positional`,
// so we implement the fallback behavior in code instead.
#[bpaf(positional("PATH"), many, guard(validate_paths, PATHS_ERROR_MESSAGE))]
Expand All @@ -44,7 +41,7 @@ pub struct FormatCommand {
/// Output Options
#[derive(Debug, Clone, Bpaf)]
pub enum OutputOptions {
/// Default - when no output option is specified, behaves like `--write`
/// Default - when no output option is specified, behaves like `--write` mode in Prettier
#[bpaf(hide)]
DefaultWrite,
/// Check mode - check if files are formatted
Expand All @@ -66,7 +63,7 @@ pub struct BasicOptions {
/// Ignore Options
#[derive(Debug, Clone, Bpaf)]
pub struct IgnoreOptions {
/// Format code in node_modules directory (disabled by default)
/// Format code in node_modules directory (skipped by default)
#[bpaf(switch, hide_usage)]
pub with_node_modules: bool,
}
Expand Down
Loading