Skip to content

Commit 48fbb10

Browse files
committed
Migrate to GitQL 0.38.0
1 parent 6ff00b8 commit 48fbb10

File tree

4 files changed

+78
-63
lines changed

4 files changed

+78
-63
lines changed

Cargo.lock

Lines changed: 52 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ categories = ["command-line-utilities"]
1313
exclude = [".github/**", "docs/**", "media/**", "scripts/**"]
1414

1515
[dependencies]
16-
gitql-core = "0.14.0"
17-
gitql-std = "0.14.0"
18-
gitql-ast = "0.33.0"
19-
gitql-parser = "0.36.0"
20-
gitql-engine = "0.37.0"
21-
gitql-cli = "0.37.0"
16+
gitql-core = "0.15.0"
17+
gitql-std = "0.15.0"
18+
gitql-ast = "0.34.0"
19+
gitql-parser = "0.37.0"
20+
gitql-engine = "0.38.0"
21+
gitql-cli = "0.38.0"
2222

2323
inkwell = { version = "0.5.0", features = ["llvm18-0"] }
2424

src/arguments.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use gitql_cli::arguments::OutputFormat;
1+
use gitql_cli::printer::OutputFormatKind;
22

33
/// Arguments for LLQL
44
#[derive(Debug, PartialEq)]
@@ -8,7 +8,7 @@ pub struct Arguments {
88
pub pagination: bool,
99
pub page_size: usize,
1010
pub enable_line_editor: bool,
11-
pub output_format: OutputFormat,
11+
pub output_format: OutputFormatKind,
1212
}
1313

1414
/// Create a new instance of Arguments with the default settings
@@ -20,7 +20,7 @@ impl Arguments {
2020
pagination: false,
2121
page_size: 10,
2222
enable_line_editor: false,
23-
output_format: OutputFormat::Render,
23+
output_format: OutputFormatKind::Table,
2424
}
2525
}
2626
}
@@ -146,11 +146,13 @@ pub fn parse_arguments(args: &[String]) -> Command {
146146

147147
let output_type = &args[arg_index].to_lowercase();
148148
if output_type == "csv" {
149-
arguments.output_format = OutputFormat::CSV;
149+
arguments.output_format = OutputFormatKind::CSV;
150150
} else if output_type == "json" {
151-
arguments.output_format = OutputFormat::JSON;
152-
} else if output_type == "render" {
153-
arguments.output_format = OutputFormat::Render;
151+
arguments.output_format = OutputFormatKind::JSON;
152+
} else if output_type == "yaml" {
153+
arguments.output_format = OutputFormatKind::YAML;
154+
} else if output_type == "render" || output_type == "table" {
155+
arguments.output_format = OutputFormatKind::Table;
154156
} else {
155157
return Command::Error("Invalid output format".to_string());
156158
}

src/main.rs

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ use std::path::Path;
55

66
use arguments::Arguments;
77
use arguments::Command;
8-
use gitql_cli::arguments::OutputFormat;
98
use gitql_cli::diagnostic_reporter;
109
use gitql_cli::diagnostic_reporter::DiagnosticReporter;
11-
use gitql_cli::printer::base::OutputPrinter;
12-
use gitql_cli::printer::csv_printer::CSVPrinter;
13-
use gitql_cli::printer::json_printer::JSONPrinter;
14-
use gitql_cli::printer::table_printer::TablePrinter;
10+
use gitql_cli::printer::BaseOutputPrinter;
11+
use gitql_cli::printer::CSVPrinter;
12+
use gitql_cli::printer::JSONPrinter;
13+
use gitql_cli::printer::OutputFormatKind;
14+
use gitql_cli::printer::TablePrinter;
15+
use gitql_cli::printer::YAMLPrinter;
1516
use gitql_core::environment::Environment;
1617
use gitql_engine::data_provider::DataProvider;
1718
use gitql_engine::engine;
@@ -234,12 +235,13 @@ fn execute_llql_query(
234235
}
235236

236237
// Render the result only if they are selected groups not any other statement
237-
let printer: Box<dyn OutputPrinter> = match arguments.output_format {
238-
OutputFormat::Render => {
238+
let printer: Box<dyn BaseOutputPrinter> = match arguments.output_format {
239+
OutputFormatKind::Table => {
239240
Box::new(TablePrinter::new(arguments.pagination, arguments.page_size))
240241
}
241-
OutputFormat::JSON => Box::new(JSONPrinter),
242-
OutputFormat::CSV => Box::new(CSVPrinter),
242+
OutputFormatKind::JSON => Box::new(JSONPrinter),
243+
OutputFormatKind::CSV => Box::new(CSVPrinter),
244+
OutputFormatKind::YAML => Box::new(YAMLPrinter),
243245
};
244246

245247
// Render the result only if they are selected groups not any other statement

0 commit comments

Comments
 (0)