Skip to content

Commit

Permalink
Merge branch 'main' into dd-reblock
Browse files Browse the repository at this point in the history
  • Loading branch information
jfinkels authored Nov 15, 2023
2 parents 6a6eba7 + da84583 commit ae9e514
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 14 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ check out these documents:

Now follows a very important warning:

> [!WARNING] uutils is original code and cannot contain any code from GNU or
> [!WARNING]
> uutils is original code and cannot contain any code from GNU or
> other implementations. This means that **we cannot accept any changes based on
> the GNU source code**. To make sure that cannot happen, **you cannot link to
> the GNU source code** either.
Expand Down
4 changes: 2 additions & 2 deletions 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ gcd = "2.3"
glob = "0.3.1"
half = "2.3"
indicatif = "0.17"
itertools = "0.11.0"
itertools = "0.12.0"
libc = "0.2.150"
lscolors = { version = "0.15.0", default-features = false, features = [
"nu-ansi-term",
Expand Down
1 change: 0 additions & 1 deletion src/uu/dd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ path = "src/dd.rs"
clap = { workspace = true }
gcd = { workspace = true }
libc = { workspace = true }
# TODO `memo` requires `quoting-style` but it doesn't specify it maybe?
uucore = { workspace = true, features = ["memo", "quoting-style"] }

[target.'cfg(any(target_os = "linux"))'.dependencies]
Expand Down
2 changes: 1 addition & 1 deletion src/uu/printf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ path = "src/printf.rs"

[dependencies]
clap = { workspace = true }
uucore = { workspace = true, features = ["memo"] }
uucore = { workspace = true, features = ["memo", "quoting-style"] }

[[bin]]
name = "printf"
Expand Down
2 changes: 1 addition & 1 deletion src/uu/seq/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bigdecimal = { workspace = true }
clap = { workspace = true }
num-bigint = { workspace = true }
num-traits = { workspace = true }
uucore = { workspace = true, features = ["memo"] }
uucore = { workspace = true, features = ["memo", "quoting-style"] }

[[bin]]
name = "seq"
Expand Down
10 changes: 7 additions & 3 deletions src/uu/split/src/platform/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ use std::io::Write;
use std::io::{BufWriter, Error, ErrorKind, Result};
use std::path::Path;
use std::process::{Child, Command, Stdio};
use uucore::crash;
use uucore::error::USimpleError;
use uucore::fs;
use uucore::fs::FileInformation;
use uucore::show;

/// A writer that writes to a shell_process' stdin
///
Expand Down Expand Up @@ -101,10 +102,13 @@ impl Drop for FilterWriter {
.expect("Couldn't wait for child process");
if let Some(return_code) = exit_status.code() {
if return_code != 0 {
crash!(1, "Shell process returned {}", return_code);
show!(USimpleError::new(
1,
format!("Shell process returned {}", return_code)
));
}
} else {
crash!(1, "Shell process terminated by signal")
show!(USimpleError::new(1, "Shell process terminated by signal"));
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@
//! formatter for unsigned and signed int subs
//! unsigned int: %X %x (hex u64) %o (octal u64) %u (base ten u64)
//! signed int: %i %d (both base ten i64)
use crate::error::set_exit_code;
use crate::features::tokenize::num_format::num_format::warn_expected_numeric;

use super::super::format_field::FormatField;
use super::super::formatter::{
get_it_at, warn_incomplete_conv, Base, FormatPrimitive, Formatter, InitialPrefix,
};
use super::super::formatter::{get_it_at, Base, FormatPrimitive, Formatter, InitialPrefix};
use std::i64;
use std::u64;

Expand Down Expand Up @@ -112,7 +113,8 @@ impl Intf {
}
}
_ => {
warn_incomplete_conv(str_in);
warn_expected_numeric(str_in);
set_exit_code(1);
break;
}
}
Expand Down
8 changes: 8 additions & 0 deletions tests/by-util/test_printf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,14 @@ fn sub_num_hex_upper() {
.stdout_only("thirty in hex is 1E");
}

#[test]
fn sub_num_hex_non_numerical() {
new_ucmd!()
.args(&["parameters need to be numbers %X", "%194"])
.fails()
.code_is(1);
}

#[test]
fn sub_num_float() {
new_ucmd!()
Expand Down

0 comments on commit ae9e514

Please sign in to comment.