mirror of
https://github.com/uutils/coreutils
synced 2024-12-14 23:32:39 +00:00
Merge pull request #398 from ebfe/deprecation
This commit is contained in:
commit
66713ba4b4
7 changed files with 10 additions and 6 deletions
|
@ -82,7 +82,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
}
|
||||
|
||||
fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
|
||||
let mut args = Vec::<String>::from_slice(args);
|
||||
let mut args = args.to_vec();
|
||||
let mut i = 0;
|
||||
while i < args.len() {
|
||||
if args[i].as_slice().char_at(0) == '-' && args[i].len() > 1 && args[i].as_slice().char_at(1).is_digit() {
|
||||
|
|
|
@ -110,7 +110,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
getopts::optflag("V", "version", "output version information and exit"),
|
||||
);
|
||||
|
||||
opts.push_all_move(get_algo_opts(binary_name.as_slice()));
|
||||
opts.extend(get_algo_opts(binary_name.as_slice()).into_iter());
|
||||
|
||||
let matches = match getopts::getopts(args.tail(), opts.as_slice()) {
|
||||
Ok(m) => m,
|
||||
|
|
|
@ -133,7 +133,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
// In case is found, the options vector will get rid of that object so that
|
||||
// getopts works correctly.
|
||||
fn obsolete(options: &[String]) -> (Vec<String>, Option<uint>) {
|
||||
let mut options: Vec<String> = Vec::from_slice(options);
|
||||
let mut options: Vec<String> = options.to_vec();
|
||||
let mut a = 0;
|
||||
let b = options.len();
|
||||
|
||||
|
|
|
@ -51,17 +51,20 @@ mod audit {
|
|||
pub type au_emod_t = c_uint;
|
||||
pub type au_class_t = c_int;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct au_mask {
|
||||
pub am_success: c_uint,
|
||||
pub am_failure: c_uint
|
||||
}
|
||||
pub type au_mask_t = au_mask;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct au_tid_addr {
|
||||
pub port: dev_t,
|
||||
}
|
||||
pub type au_tid_addr_t = au_tid_addr;
|
||||
|
||||
#[repr(C)]
|
||||
pub struct c_auditinfo_addr {
|
||||
pub ai_auid: au_id_t, /* Audit user ID */
|
||||
pub ai_mask: au_mask_t, /* Audit masks. */
|
||||
|
|
|
@ -65,7 +65,7 @@ fn parse_options(args: Vec<String>, options: &mut SeqOptions) -> Result<Vec<Stri
|
|||
},
|
||||
"-w" | "--widths" => options.widths = true,
|
||||
"--" => {
|
||||
seq_args.push_all_move(iter.collect());
|
||||
seq_args.extend(iter);
|
||||
break;
|
||||
},
|
||||
_ => {
|
||||
|
|
|
@ -119,7 +119,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
// In case is found, the options vector will get rid of that object so that
|
||||
// getopts works correctly.
|
||||
fn obsolete (options: &[String]) -> (Vec<String>, Option<uint>) {
|
||||
let mut options: Vec<String> = Vec::from_slice(options);
|
||||
let mut options: Vec<String> = options.to_vec();
|
||||
let mut a = 0;
|
||||
let b = options.len();
|
||||
|
||||
|
|
|
@ -59,7 +59,8 @@ fn options(args: &[String]) -> Result<Options, ()> {
|
|||
let help = format!("{}\n\nUsage:\n {} {}\n\n{}\n{}",
|
||||
version, program, arguments, usage(brief, opts),
|
||||
comment);
|
||||
let names = m.free.clone().into_iter().collect::<Vec<String>>().append_one("-".to_string());
|
||||
let mut names = m.free.clone().into_iter().collect::<Vec<String>>();
|
||||
names.push("-".to_string());
|
||||
let to_print = if m.opt_present("help") { Some(help) }
|
||||
else if m.opt_present("version") { Some(version) }
|
||||
else { None };
|
||||
|
|
Loading…
Reference in a new issue