Skip to content

Commit

Permalink
Merge pull request #3 from kennytm/fix-2
Browse files Browse the repository at this point in the history
Fix incorrect clap usage
  • Loading branch information
kennytm authored Mar 18, 2024
2 parents 0a701fe + 245c6be commit 5802fd8
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 42 deletions.
6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ rand = { version = "0.8.5", default-features = false, features = ["getrandom"] }
data-encoding = "2.4"
data-encoding-macro = "0.1"
regex-syntax = "0.7"
pbr = { version = "1.1", optional = true }
# the progress bar will prevent dbgen from finishing
# forcing a git dependency until https://github.com/a8m/pb/pull/120 is released
pbr = { version = "1.1", optional = true, git = "https://github.com/a8m/pb.git", rev = "d60b964be6a234c933fdf95d7b7851f383e21206" }
num-traits = "0.2"
rayon = { version = "1.7", optional = true }
zipf = "7.0"
zipf = "7.0.1"
chrono = { version = "0.4.26", default-features = false, features = ["std", "serde", "clock"] }
tzfile = "0.1"
ryu = "1.0"
Expand Down
2 changes: 1 addition & 1 deletion dbdbgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ dbgen = { path = "../" }
jsonnet-rs = "0.17"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
clap = { version = "4.3", features = ["string"] }
clap = { version = "4.5", features = ["string"] }
thiserror = "1.0"
rand_core = { version = "0.6", features = ["getrandom"] }
data-encoding = "2.4"
Expand Down
6 changes: 3 additions & 3 deletions dbdbgen/src/bin/dbdbgen.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use clap::{Arg, ArgAction, Command};
use dbdbgen::{cli::ensure_seed, error::Error, jsvm::Vm};
use dbgen::{span::Registry, FULL_VERSION};
use std::{error::Error as StdError, ffi::OsStr};
use std::error::Error as StdError;

fn run() -> Result<(), Error> {
let global_matches = Command::new("dbdbgen")
Expand All @@ -23,8 +23,8 @@ fn run() -> Result<(), Error> {
.allow_hyphen_values(true),
])
.get_matches();
let mut args = global_matches.get_many("file").unwrap();
let src_file: &&OsStr = args.next().unwrap();
let mut args = global_matches.get_raw("file").unwrap();
let src_file = args.next().unwrap();

let mut vm = Vm::new(src_file, global_matches.get_flag("allow-import"))?;
let app = vm.eval_arguments()?;
Expand Down
2 changes: 1 addition & 1 deletion dbdbgen/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl App {
ArgType::Float => Match::Float(get_one!(f64)),
ArgType::Choices { multiple: true, .. } => {
if let Some(values) = matches.get_many(name) {
Match::Array(values.map(|s: &&str| s.to_string()).collect())
Match::Array(values.cloned().collect())
} else {
continue;
}
Expand Down
70 changes: 35 additions & 35 deletions tests/data/seeded-hc128/result.1.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@ INSERT INTO result VALUES
(1, 4, 5),
(2, 2, 1),
(3, 6, 8),
(4, 4, 2),
(4, 4, 3),
(5, 1, 3),
(6, 8, 1),
(7, 3, 6),
(7, 3, 7),
(8, 2, 1),
(9, 9, 4),
(9, 9, 5),
(10, 2, 9),
(11, 2, 2),
(12, 1, 2),
(13, 9, 2),
(14, 3, 3),
(11, 2, 3),
(12, 1, 3),
(13, 9, 3),
(14, 3, 4),
(15, 3, 1),
(16, 5, 6),
(16, 5, 7),
(17, 9, 1),
(18, 3, 1),
(19, 2, 1),
Expand All @@ -30,72 +30,72 @@ INSERT INTO result VALUES
(29, 7, 1),
(30, 2, 8),
(31, 2, 9),
(32, 3, 3),
(32, 3, 4),
(33, 2, 1),
(34, 2, 5),
(35, 7, 4),
(35, 7, 5),
(36, 8, 3),
(37, 9, 1),
(38, 0, 2),
(39, 6, 9),
(40, 1, 5),
(39, 6, 10),
(40, 1, 6),
(41, 9, 1),
(42, 0, 4),
(42, 0, 5),
(43, 9, 5),
(44, 2, 1),
(45, 7, 1),
(46, 7, 1),
(47, 4, 6),
(48, 9, 9),
(48, 9, 10),
(49, 5, 7),
(50, 7, 1),
(51, 5, 5),
(52, 9, 8),
(53, 7, 2),
(52, 9, 9),
(53, 7, 3),
(54, 6, 3),
(55, 0, 5),
(56, 1, 1),
(57, 2, 1),
(55, 0, 6),
(56, 1, 2),
(57, 2, 2),
(58, 5, 4),
(59, 3, 5),
(60, 1, 4),
(61, 7, 6),
(61, 7, 7),
(62, 9, 1),
(63, 8, 3),
(64, 4, 1),
(65, 9, 5),
(65, 9, 6),
(66, 5, 1),
(67, 0, 1),
(68, 8, 4),
(67, 0, 2),
(68, 8, 5),
(69, 3, 10),
(70, 2, 2),
(70, 2, 3),
(71, 0, 5),
(72, 8, 1),
(73, 4, 5),
(73, 4, 6),
(74, 9, 1),
(75, 7, 1),
(76, 5, 1),
(77, 2, 6),
(78, 8, 8),
(79, 2, 1),
(80, 8, 3),
(81, 6, 2),
(78, 8, 9),
(79, 2, 2),
(80, 8, 4),
(81, 6, 3),
(82, 3, 8),
(83, 3, 2),
(84, 6, 9),
(85, 9, 3),
(86, 8, 7),
(87, 1, 5),
(88, 0, 2),
(86, 8, 8),
(87, 1, 6),
(88, 0, 3),
(89, 5, 1),
(90, 4, 1),
(91, 7, 1),
(92, 3, 1),
(93, 8, 1),
(94, 8, 1),
(95, 0, 6),
(96, 6, 3),
(97, 1, 7),
(96, 6, 4),
(97, 1, 8),
(98, 8, 4),
(99, 0, 4),
(99, 0, 5),
(100, 7, 2);

0 comments on commit 5802fd8

Please sign in to comment.