Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

up(cli): support --version #2154

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/oxc_cli/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "oxc_cli"
version = "0.0.0"
version = "0.5.0"
publish = false
authors.workspace = true
description.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions crates/oxc_cli/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use oxc_linter::AllowWarnDeny;
use std::{ffi::OsString, path::PathBuf};

#[derive(Debug, Clone, Bpaf)]
#[bpaf(options)]
#[bpaf(options, version)]
pub enum CliCommand {
/// Lint this repository
#[bpaf(command)]
Expand Down Expand Up @@ -37,7 +37,7 @@ impl CliCommand {
// <https://docs.rs/bpaf/latest/bpaf/struct.OptionParser.html#method.descr>
/// Linter for the JavaScript Oxidation Compiler
#[derive(Debug, Clone, Bpaf)]
#[bpaf(options)]
#[bpaf(options, version)]
pub struct LintCommand {
#[bpaf(external(lint_options))]
pub lint_options: LintOptions,
Expand All @@ -51,7 +51,7 @@ impl LintCommand {

/// Formatter for the JavaScript Oxidation Compiler
#[derive(Debug, Clone, Bpaf)]
#[bpaf(options)]
#[bpaf(options, version)]
pub struct FormatCommand {
#[bpaf(external(format_options))]
pub format_options: FormatOptions,
Expand Down
2 changes: 1 addition & 1 deletion crates/oxc_cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
use oxc_cli::{CliCommand, CliRunResult, FormatRunner, LintRunner, Runner};

fn main() -> CliRunResult {
let options = oxc_cli::cli_command().fallback_to_usage().run();
let options: CliCommand = oxc_cli::cli_command().fallback_to_usage().run();
options.handle_threads();
match options {
CliCommand::Lint(options) => LintRunner::new(options).run(),
Expand Down