mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Removes project-specific cspell files.
This commit is contained in:
parent
6184267660
commit
076ff32e85
7 changed files with 138 additions and 159 deletions
2
.vscode/cSpell.json
vendored
2
.vscode/cSpell.json
vendored
|
@ -11,7 +11,7 @@
|
||||||
{ "name": "workspace", "path": "./cspell.dictionaries/workspace.wordlist.txt" }
|
{ "name": "workspace", "path": "./cspell.dictionaries/workspace.wordlist.txt" }
|
||||||
],
|
],
|
||||||
// ignorePaths - a list of globs to specify which files are to be ignored
|
// ignorePaths - a list of globs to specify which files are to be ignored
|
||||||
"ignorePaths": ["Cargo.lock", "target/**", "tests/**/fixtures/**"],
|
"ignorePaths": ["Cargo.lock", "target/**", "tests/**/fixtures/**", "src/uu/dd/test-resources/**"],
|
||||||
// ignoreWords - a list of words to be ignored (even if they are in the flagWords)
|
// ignoreWords - a list of words to be ignored (even if they are in the flagWords)
|
||||||
"ignoreWords": [],
|
"ignoreWords": [],
|
||||||
// words - list of words to be always considered correct
|
// words - list of words to be always considered correct
|
||||||
|
|
19
.vscode/cspell.dictionaries/jargon.wordlist.txt
vendored
19
.vscode/cspell.dictionaries/jargon.wordlist.txt
vendored
|
@ -12,6 +12,7 @@ colorizable
|
||||||
colorize
|
colorize
|
||||||
coprime
|
coprime
|
||||||
consts
|
consts
|
||||||
|
conv
|
||||||
cyclomatic
|
cyclomatic
|
||||||
dedup
|
dedup
|
||||||
deduplication
|
deduplication
|
||||||
|
@ -23,6 +24,7 @@ dev
|
||||||
devs
|
devs
|
||||||
discoverability
|
discoverability
|
||||||
duplicative
|
duplicative
|
||||||
|
dsync
|
||||||
enqueue
|
enqueue
|
||||||
errored
|
errored
|
||||||
executable
|
executable
|
||||||
|
@ -30,7 +32,10 @@ executables
|
||||||
exponentiate
|
exponentiate
|
||||||
eval
|
eval
|
||||||
falsey
|
falsey
|
||||||
|
fileio
|
||||||
flamegraph
|
flamegraph
|
||||||
|
fullblock
|
||||||
|
gibi
|
||||||
gibibytes
|
gibibytes
|
||||||
glob
|
glob
|
||||||
globbing
|
globbing
|
||||||
|
@ -39,8 +44,12 @@ hardlink
|
||||||
hardlinks
|
hardlinks
|
||||||
hasher
|
hasher
|
||||||
hashsums
|
hashsums
|
||||||
|
infile
|
||||||
|
iflag
|
||||||
|
iflags
|
||||||
kibi
|
kibi
|
||||||
kibibytes
|
kibibytes
|
||||||
|
lcase
|
||||||
mebi
|
mebi
|
||||||
mebibytes
|
mebibytes
|
||||||
mergeable
|
mergeable
|
||||||
|
@ -49,8 +58,15 @@ microbenchmarks
|
||||||
microbenchmarking
|
microbenchmarking
|
||||||
multibyte
|
multibyte
|
||||||
multicall
|
multicall
|
||||||
|
noatime
|
||||||
|
nocreat
|
||||||
nonportable
|
nonportable
|
||||||
nonprinting
|
nonprinting
|
||||||
|
notrunc
|
||||||
|
noxfer
|
||||||
|
ofile
|
||||||
|
oflag
|
||||||
|
oflags
|
||||||
peekable
|
peekable
|
||||||
performant
|
performant
|
||||||
precompiled
|
precompiled
|
||||||
|
@ -73,6 +89,7 @@ shortcodes
|
||||||
subcommand
|
subcommand
|
||||||
subexpression
|
subexpression
|
||||||
submodule
|
submodule
|
||||||
|
sync
|
||||||
symlink
|
symlink
|
||||||
symlinks
|
symlinks
|
||||||
syscall
|
syscall
|
||||||
|
@ -80,12 +97,14 @@ syscalls
|
||||||
tokenize
|
tokenize
|
||||||
toolchain
|
toolchain
|
||||||
truthy
|
truthy
|
||||||
|
ucase
|
||||||
unbuffered
|
unbuffered
|
||||||
unescape
|
unescape
|
||||||
unintuitive
|
unintuitive
|
||||||
unprefixed
|
unprefixed
|
||||||
unportable
|
unportable
|
||||||
unsync
|
unsync
|
||||||
|
urand
|
||||||
whitespace
|
whitespace
|
||||||
wordlist
|
wordlist
|
||||||
wordlists
|
wordlists
|
||||||
|
|
|
@ -1,67 +0,0 @@
|
||||||
{
|
|
||||||
"version": "0.1",
|
|
||||||
"language": "en",
|
|
||||||
"words": [
|
|
||||||
"ucase",
|
|
||||||
"lcase",
|
|
||||||
"nocreat",
|
|
||||||
"noerror",
|
|
||||||
"notrunc",
|
|
||||||
"nocache",
|
|
||||||
"dsync",
|
|
||||||
"sync",
|
|
||||||
"nonblock",
|
|
||||||
"noctty",
|
|
||||||
"nofollow",
|
|
||||||
"nolinks",
|
|
||||||
"fullblock",
|
|
||||||
"noxfer",
|
|
||||||
"iflag",
|
|
||||||
"iflags",
|
|
||||||
"oflag",
|
|
||||||
"oflags",
|
|
||||||
"infile",
|
|
||||||
"outfile",
|
|
||||||
"fileio",
|
|
||||||
"urand",
|
|
||||||
"xfer",
|
|
||||||
"cflags",
|
|
||||||
"ctable",
|
|
||||||
"gnudd",
|
|
||||||
"atoe",
|
|
||||||
"etoa",
|
|
||||||
"atoibm",
|
|
||||||
"bmax",
|
|
||||||
"datastructures",
|
|
||||||
"creat",
|
|
||||||
"mult",
|
|
||||||
"behaviour",
|
|
||||||
"ctty",
|
|
||||||
"noatime",
|
|
||||||
"fname",
|
|
||||||
"fileout",
|
|
||||||
"ofile",
|
|
||||||
"doesnt",
|
|
||||||
"parseargs",
|
|
||||||
"rlen",
|
|
||||||
"wlen",
|
|
||||||
"rstat",
|
|
||||||
"wstat",
|
|
||||||
"rposition",
|
|
||||||
"btotal",
|
|
||||||
"sigval",
|
|
||||||
"sigusr",
|
|
||||||
"rmax",
|
|
||||||
"rsofar",
|
|
||||||
"rremain",
|
|
||||||
"bremain",
|
|
||||||
"oconvflags",
|
|
||||||
"fpath",
|
|
||||||
"testfile",
|
|
||||||
"specfile"
|
|
||||||
],
|
|
||||||
"ignorePaths": [
|
|
||||||
"**/test-resources/*.test",
|
|
||||||
"**/test-resources/*.spec"
|
|
||||||
]
|
|
||||||
}
|
|
|
@ -714,6 +714,10 @@ fn gen_prog_updater(rx: mpsc::Receiver<ProgUpdate>, print_level: Option<StatusLe
|
||||||
fn posixly_correct() -> bool {
|
fn posixly_correct() -> bool {
|
||||||
env::var("POSIXLY_CORRECT").is_ok()
|
env::var("POSIXLY_CORRECT").is_ok()
|
||||||
}
|
}
|
||||||
|
// Since signal-prompted progress printing is only availible on Linux so far, we allow unused
|
||||||
|
// variables to remove build warnings on Windows and other platforms.
|
||||||
|
// Remove when possible.
|
||||||
|
#[allow(unused_variables)]
|
||||||
fn register_signal_handlers(sigval: Arc<AtomicUsize>) -> Result<(), Box<dyn Error>> {
|
fn register_signal_handlers(sigval: Arc<AtomicUsize>) -> Result<(), Box<dyn Error>> {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if !posixly_correct() {
|
if !posixly_correct() {
|
||||||
|
@ -1028,61 +1032,81 @@ pub fn uu_app() -> clap::App<'static, 'static> {
|
||||||
clap::Arg::with_name(options::INFILE)
|
clap::Arg::with_name(options::INFILE)
|
||||||
.long(options::INFILE)
|
.long(options::INFILE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("if=FILE (alternatively --if FILE) specifies the file used for input. When not specified, stdin is used instead")
|
.require_equals(true)
|
||||||
|
.value_name("FILE")
|
||||||
|
.help("(alternatively if=FILE) specifies the file used for input. When not specified, stdin is used instead")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::OUTFILE)
|
clap::Arg::with_name(options::OUTFILE)
|
||||||
.long(options::OUTFILE)
|
.long(options::OUTFILE)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("of=FILE (alternatively --of FILE) specifies the file used for output. When not specified, stdout is used instead")
|
.require_equals(true)
|
||||||
|
.value_name("FILE")
|
||||||
|
.help("(alternatively of=FILE) specifies the file used for output. When not specified, stdout is used instead")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::IBS)
|
clap::Arg::with_name(options::IBS)
|
||||||
.long(options::IBS)
|
.long(options::IBS)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("ibs=N (alternatively --ibs N) specifies the size of buffer used for reads (default: 512). Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively ibs=N) specifies the size of buffer used for reads (default: 512). Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::OBS)
|
clap::Arg::with_name(options::OBS)
|
||||||
.long(options::OBS)
|
.long(options::OBS)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("obs=N (alternatively --obs N) specifies the size of buffer used for writes (default: 512). Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively obs=N) specifies the size of buffer used for writes (default: 512). Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::BS)
|
clap::Arg::with_name(options::BS)
|
||||||
.long(options::BS)
|
.long(options::BS)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("bs=N (alternatively --bs N) specifies ibs=N and obs=N (default: 512). If ibs or obs are also specified, bs=N takes precedence. Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively bs=N) specifies ibs=N and obs=N (default: 512). If ibs or obs are also specified, bs=N takes precedence. Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::CBS)
|
clap::Arg::with_name(options::CBS)
|
||||||
.long(options::CBS)
|
.long(options::CBS)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("cbs=BYTES (alternatively --cbs BYTES) specifies the 'conversion block size' in bytes. Applies to the conv=block, and conv=unblock operations. Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively cbs=BYTES) specifies the 'conversion block size' in bytes. Applies to the conv=block, and conv=unblock operations. Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::SKIP)
|
clap::Arg::with_name(options::SKIP)
|
||||||
.long(options::SKIP)
|
.long(options::SKIP)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("skip=N (alternatively --skip N) causes N ibs-sized records of input to be skipped before beginning copy/convert operations. See iflag=count_bytes if skipping N bytes is preferred. Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively skip=N) causes N ibs-sized records of input to be skipped before beginning copy/convert operations. See iflag=count_bytes if skipping N bytes is preferred. Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::SEEK)
|
clap::Arg::with_name(options::SEEK)
|
||||||
.long(options::SEEK)
|
.long(options::SEEK)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("seek=N (alternatively --seek N) seeks N obs-sized records into output before beginning copy/convert operations. See oflag=seek_bytes if seeking N bytes is preferred. Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively seek=N) seeks N obs-sized records into output before beginning copy/convert operations. See oflag=seek_bytes if seeking N bytes is preferred. Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::COUNT)
|
clap::Arg::with_name(options::COUNT)
|
||||||
.long(options::COUNT)
|
.long(options::COUNT)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("count=N (alternatively --count N) stop reading input after N ibs-sized read operations rather than proceeding until EOF. See iflag=count_bytes if stopping after N bytes is preferred. Multiplier strings permitted.")
|
.require_equals(true)
|
||||||
|
.value_name("N")
|
||||||
|
.help("(alternatively count=N) stop reading input after N ibs-sized read operations rather than proceeding until EOF. See iflag=count_bytes if stopping after N bytes is preferred. Multiplier strings permitted.")
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(
|
||||||
clap::Arg::with_name(options::STATUS)
|
clap::Arg::with_name(options::STATUS)
|
||||||
.long(options::STATUS)
|
.long(options::STATUS)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("status=LEVEL (alternatively --status LEVEL) controls whether volume and performance stats are written to stderr.
|
.require_equals(true)
|
||||||
|
.value_name("LEVEL")
|
||||||
|
.help("(alternatively status=LEVEL) controls whether volume and performance stats are written to stderr.
|
||||||
|
|
||||||
When unspecified, dd will print stats upon completion. An example is below.
|
When unspecified, dd will print stats upon completion. An example is below.
|
||||||
\t6+0 records in
|
\t6+0 records in
|
||||||
|
@ -1104,7 +1128,9 @@ Printing performance stats is also triggered by the INFO signal (where supported
|
||||||
clap::Arg::with_name(options::CONV)
|
clap::Arg::with_name(options::CONV)
|
||||||
.long(options::CONV)
|
.long(options::CONV)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("conv=CONV[,CONV] (alternatively --conv CONV[,CONV]) specifies a comma-separated list of conversion options or (for legacy reasons) file flags. Conversion options and file flags may be intermixed.
|
.require_equals(true)
|
||||||
|
.value_name("CONV")
|
||||||
|
.help("(alternatively conv=CONV[,CONV]) specifies a comma-separated list of conversion options or (for legacy reasons) file flags. Conversion options and file flags may be intermixed.
|
||||||
|
|
||||||
Conversion options:
|
Conversion options:
|
||||||
\t One of {ascii, ebcdic, ibm} will perform an encoding conversion.
|
\t One of {ascii, ebcdic, ibm} will perform an encoding conversion.
|
||||||
|
@ -1139,7 +1165,9 @@ Conversion Flags:
|
||||||
clap::Arg::with_name(options::IFLAG)
|
clap::Arg::with_name(options::IFLAG)
|
||||||
.long(options::IFLAG)
|
.long(options::IFLAG)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("iflag=FLAG[,FLAG] (alternatively --iflag FLAG[,FLAG]) a comma separated list of input flags which specify how the input source is treated. FLAG may be any of the input-flags or general-flags specified below.
|
.require_equals(true)
|
||||||
|
.value_name("FLAG")
|
||||||
|
.help("(alternatively iflag=FLAG[,FLAG]) a comma separated list of input flags which specify how the input source is treated. FLAG may be any of the input-flags or general-flags specified below.
|
||||||
|
|
||||||
Input-Flags
|
Input-Flags
|
||||||
\t 'count_bytes' a value to count=N will be interpreted as bytes.
|
\t 'count_bytes' a value to count=N will be interpreted as bytes.
|
||||||
|
@ -1163,7 +1191,9 @@ General-Flags
|
||||||
clap::Arg::with_name(options::OFLAG)
|
clap::Arg::with_name(options::OFLAG)
|
||||||
.long(options::OFLAG)
|
.long(options::OFLAG)
|
||||||
.takes_value(true)
|
.takes_value(true)
|
||||||
.help("oflag=FLAG[,FLAG] (alternatively --oflag FLAG[,FLAG]) a comma separated list of output flags which specify how the output source is treated. FLAG may be any of the output-flags or general-flags specified below.
|
.require_equals(true)
|
||||||
|
.value_name("FLAG")
|
||||||
|
.help("(alternatively oflag=FLAG[,FLAG]) a comma separated list of output flags which specify how the output source is treated. FLAG may be any of the output-flags or general-flags specified below.
|
||||||
|
|
||||||
Output-Flags
|
Output-Flags
|
||||||
\t 'append' open file in append mode. Consider setting conv=notrunc as well.
|
\t 'append' open file in append mode. Consider setting conv=notrunc as well.
|
||||||
|
|
|
@ -104,7 +104,7 @@ fn test_status_level_none() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_all_top_level_args_no_leading_dashes_sep_by_equals() {
|
fn test_all_top_level_args_no_leading_dashes() {
|
||||||
let args = vec![
|
let args = vec![
|
||||||
String::from("dd"),
|
String::from("dd"),
|
||||||
String::from("if=foo.file"),
|
String::from("if=foo.file"),
|
||||||
|
@ -187,25 +187,23 @@ fn test_all_top_level_args_no_leading_dashes_sep_by_equals() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[ignore]
|
|
||||||
#[test]
|
#[test]
|
||||||
// TODO: This should work, but Clap doesn't seem to understand it. Leaving it for now since the traditional dd if=foo.file works just fine.
|
fn test_all_top_level_args_with_leading_dashes() {
|
||||||
fn test_all_top_level_args_leading_dashes_sep_by_spaces() {
|
|
||||||
let args = vec![
|
let args = vec![
|
||||||
String::from("dd"),
|
String::from("dd"),
|
||||||
String::from("--if foo.file"),
|
String::from("--if=foo.file"),
|
||||||
String::from("--of bar.file"),
|
String::from("--of=bar.file"),
|
||||||
String::from("--ibs 10"),
|
String::from("--ibs=10"),
|
||||||
String::from("--obs 10"),
|
String::from("--obs=10"),
|
||||||
String::from("--cbs 1"),
|
String::from("--cbs=1"),
|
||||||
String::from("--bs 100"),
|
String::from("--bs=100"),
|
||||||
String::from("--count 2"),
|
String::from("--count=2"),
|
||||||
String::from("--skip 2"),
|
String::from("--skip=2"),
|
||||||
String::from("--seek 2"),
|
String::from("--seek=2"),
|
||||||
String::from("--status progress"),
|
String::from("--status=progress"),
|
||||||
String::from("--conv ascii,ucase"),
|
String::from("--conv=ascii,ucase"),
|
||||||
String::from("--iflag count_bytes,skip_bytes"),
|
String::from("--iflag=count_bytes,skip_bytes"),
|
||||||
String::from("--oflag append,seek_bytes"),
|
String::from("--oflag=append,seek_bytes"),
|
||||||
];
|
];
|
||||||
let args = args
|
let args = args
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -415,27 +413,13 @@ fn parse_iflag_tokens() {
|
||||||
Flag::FullBlock,
|
Flag::FullBlock,
|
||||||
Flag::CountBytes,
|
Flag::CountBytes,
|
||||||
Flag::SkipBytes,
|
Flag::SkipBytes,
|
||||||
// Flag::Cio,
|
|
||||||
Flag::Direct,
|
|
||||||
Flag::Directory,
|
|
||||||
Flag::Dsync,
|
|
||||||
Flag::Sync,
|
|
||||||
// Flag::NoCache,
|
|
||||||
Flag::NonBlock,
|
|
||||||
Flag::NoATime,
|
|
||||||
Flag::NoCtty,
|
|
||||||
Flag::NoFollow,
|
|
||||||
// Flag::NoLinks,
|
|
||||||
// Flag::Binary,
|
|
||||||
// Flag::Text,
|
|
||||||
Flag::Append,
|
Flag::Append,
|
||||||
Flag::SeekBytes,
|
Flag::SeekBytes,
|
||||||
];
|
];
|
||||||
|
|
||||||
let args = vec![
|
let args = vec![
|
||||||
String::from("dd"),
|
String::from("dd"),
|
||||||
String::from("--iflag=fullblock,count_bytes,skip_bytes,direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow,append,seek_bytes"),
|
String::from("--iflag=fullblock,count_bytes,skip_bytes,append,seek_bytes"),
|
||||||
// String::from("--iflag=fullblock,count_bytes,skip_bytes,cio,direct,directory,dsync,sync,nocache,nonblock,noatime,noctty,nofollow,nolinks,binary,text,append,seek_bytes"),
|
|
||||||
];
|
];
|
||||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||||
|
|
||||||
|
@ -453,27 +437,69 @@ fn parse_oflag_tokens() {
|
||||||
Flag::FullBlock,
|
Flag::FullBlock,
|
||||||
Flag::CountBytes,
|
Flag::CountBytes,
|
||||||
Flag::SkipBytes,
|
Flag::SkipBytes,
|
||||||
// Flag::Cio,
|
|
||||||
Flag::Direct,
|
|
||||||
Flag::Directory,
|
|
||||||
Flag::Dsync,
|
|
||||||
Flag::Sync,
|
|
||||||
// Flag::NoCache,
|
|
||||||
Flag::NonBlock,
|
|
||||||
Flag::NoATime,
|
|
||||||
Flag::NoCtty,
|
|
||||||
Flag::NoFollow,
|
|
||||||
// Flag::NoLinks,
|
|
||||||
// Flag::Binary,
|
|
||||||
// Flag::Text,
|
|
||||||
Flag::Append,
|
Flag::Append,
|
||||||
Flag::SeekBytes,
|
Flag::SeekBytes,
|
||||||
];
|
];
|
||||||
|
|
||||||
let args = vec![
|
let args = vec![
|
||||||
String::from("dd"),
|
String::from("dd"),
|
||||||
String::from("--oflag=fullblock,count_bytes,skip_bytes,direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow,append,seek_bytes"),
|
String::from("--oflag=fullblock,count_bytes,skip_bytes,append,seek_bytes"),
|
||||||
// String::from("--oflag=fullblock,count_bytes,skip_bytes,cio,direct,directory,dsync,sync,nocache,nonblock,noatime,noctty,nofollow,nolinks,binary,text,append,seek_bytes"),
|
];
|
||||||
|
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||||
|
|
||||||
|
let act = parse_flag_list::<Flag>("oflag", &matches).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(exp.len(), act.len());
|
||||||
|
for cf in &exp {
|
||||||
|
assert!(exp.contains(&cf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
#[test]
|
||||||
|
fn parse_iflag_tokens_linux() {
|
||||||
|
let exp = vec![
|
||||||
|
Flag::Direct,
|
||||||
|
Flag::Directory,
|
||||||
|
Flag::Dsync,
|
||||||
|
Flag::Sync,
|
||||||
|
Flag::NonBlock,
|
||||||
|
Flag::NoATime,
|
||||||
|
Flag::NoCtty,
|
||||||
|
Flag::NoFollow,
|
||||||
|
];
|
||||||
|
|
||||||
|
let args = vec![
|
||||||
|
String::from("dd"),
|
||||||
|
String::from("--iflag=direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow"),
|
||||||
|
];
|
||||||
|
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||||
|
|
||||||
|
let act = parse_flag_list::<Flag>("iflag", &matches).unwrap();
|
||||||
|
|
||||||
|
assert_eq!(exp.len(), act.len());
|
||||||
|
for cf in &exp {
|
||||||
|
assert!(exp.contains(&cf));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[cfg(target_os = "linux")]
|
||||||
|
#[test]
|
||||||
|
fn parse_oflag_tokens_linux() {
|
||||||
|
let exp = vec![
|
||||||
|
Flag::Direct,
|
||||||
|
Flag::Directory,
|
||||||
|
Flag::Dsync,
|
||||||
|
Flag::Sync,
|
||||||
|
Flag::NonBlock,
|
||||||
|
Flag::NoATime,
|
||||||
|
Flag::NoCtty,
|
||||||
|
Flag::NoFollow,
|
||||||
|
];
|
||||||
|
|
||||||
|
let args = vec![
|
||||||
|
String::from("dd"),
|
||||||
|
String::from("--oflag=direct,directory,dsync,sync,nonblock,noatime,noctty,nofollow"),
|
||||||
];
|
];
|
||||||
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
let matches = uu_app().get_matches_from_safe(args).unwrap();
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
// spell-checker:ignore fname, tname, fpath, specfile, testfile, unspec, ifile, ofile, outfile, fullblock, urand, fileio
|
||||||
|
|
||||||
use crate::common::util::*;
|
use crate::common::util::*;
|
||||||
|
|
||||||
use std::fs::{File, OpenOptions};
|
use std::fs::{File, OpenOptions};
|
||||||
|
|
31
tests/fixtures/dd/cspell.json
vendored
31
tests/fixtures/dd/cspell.json
vendored
|
@ -1,31 +0,0 @@
|
||||||
{
|
|
||||||
"version": "0.1",
|
|
||||||
"language": "en",
|
|
||||||
"words": [
|
|
||||||
"fname",
|
|
||||||
"fpath",
|
|
||||||
"specfile",
|
|
||||||
"testfile",
|
|
||||||
"iflag",
|
|
||||||
"iflags",
|
|
||||||
"oflag",
|
|
||||||
"oflags",
|
|
||||||
"noxfer",
|
|
||||||
"nocreat",
|
|
||||||
"noatime",
|
|
||||||
"infile",
|
|
||||||
"outfile",
|
|
||||||
"unspec",
|
|
||||||
"fullblock",
|
|
||||||
"urand",
|
|
||||||
"tname",
|
|
||||||
"fileio",
|
|
||||||
"gibi",
|
|
||||||
"ucase",
|
|
||||||
"lcase"
|
|
||||||
],
|
|
||||||
"ignorePaths": [
|
|
||||||
"*.txt",
|
|
||||||
"*.spec"
|
|
||||||
]
|
|
||||||
}
|
|
Loading…
Add table
Add a link
Reference in a new issue