1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 05:57:46 +00:00

Fix groups and logname.

Minor upgrades and whitespace corrections.
This commit is contained in:
Joseph Crail 2015-04-30 17:56:35 -04:00
parent 521166cff9
commit c7d07315b8
2 changed files with 18 additions and 24 deletions

View file

@ -1,5 +1,5 @@
#![crate_name = "groups"]
#![feature(collections, rustc_private)]
#![feature(rustc_private)]
/*
* This file is part of the uutils coreutils package.
@ -12,12 +12,9 @@
*/
extern crate getopts;
use getopts::{
optflag,
getopts,
usage
};
use c_types::{get_pw_from_args, group};
use getopts::{getopts, optflag, usage};
use std::io::Write;
#[path = "../common/util.rs"] #[macro_use] mod util;
#[path = "../common/c_types.rs"] mod c_types;
@ -33,7 +30,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
optflag("V", "version", "display version information and exit")
];
let matches = match getopts(args.tail(), &options) {
let matches = match getopts(&args[1..], &options) {
Ok(m) => { m },
Err(f) => {
show_error!("{}", f);

View file

@ -1,5 +1,5 @@
#![crate_name = "logname"]
#![feature(collections, core, old_io, rustc_private, std_misc)]
#![feature(rustc_private)]
/*
* This file is part of the uutils coreutils package.
@ -12,14 +12,11 @@
/* last synced with: logname (GNU coreutils) 8.22 */
#![allow(non_camel_case_types)]
extern crate getopts;
extern crate libc;
use std::ffi::CStr;
use std::old_io::print;
use libc::c_char;
use std::io::Write;
#[path = "../common/util.rs"] #[macro_use] mod util;
@ -57,7 +54,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
getopts::optflag("V", "version", "output version information and exit"),
];
let matches = match getopts::getopts(args.tail(), &opts) {
let matches = match getopts::getopts(&args[1..], &opts) {
Ok(m) => m,
Err(f) => crash!(1, "Invalid options\n{}", f)
};
@ -68,7 +65,7 @@ pub fn uumain(args: Vec<String>) -> i32 {
println!("Usage:");
println!(" {}", program);
println!("");
print(getopts::usage("print user's login name", &opts).as_slice());
print!("{}", getopts::usage("print user's login name", &opts));
return 0;
}
if matches.opt_present("version") {