mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
Merge branch 'master' of github.com:uutils/coreutils into add-echo
This commit is contained in:
commit
2bdc925fbc
3 changed files with 17 additions and 5 deletions
12
README.md
12
README.md
|
@ -16,6 +16,18 @@ are either old, abandonned, hosted on CVS, written in platform-specific C, etc.
|
||||||
Rust provides a good platform-agnostic way of writing systems utils that are easy
|
Rust provides a good platform-agnostic way of writing systems utils that are easy
|
||||||
to compile anywhere, and this is as good a way as any to try and learn it.
|
to compile anywhere, and this is as good a way as any to try and learn it.
|
||||||
|
|
||||||
|
Contribute
|
||||||
|
----------
|
||||||
|
|
||||||
|
Contributions are very welcome. You may *claim* an item on the to-do list by following these steps:
|
||||||
|
|
||||||
|
1. Open an issue named "Implement [the utility of your choice]", e.g. "Implement ls"
|
||||||
|
2. State that you are working on this utility.
|
||||||
|
3. Develop the utility.
|
||||||
|
4. Submit a pull request and close the issue. Your pull request should include deleting the utility from the to-do list on this README.
|
||||||
|
|
||||||
|
The steps above imply that, before starting to work on a utility, you should search the issues to make sure no one else is working on it.
|
||||||
|
|
||||||
To do
|
To do
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
|
@ -182,7 +182,7 @@ fn open(path: ~str) -> Option<~Reader> {
|
||||||
return Some(~stdin() as ~Reader);
|
return Some(~stdin() as ~Reader);
|
||||||
}
|
}
|
||||||
|
|
||||||
match result(|| File::open(&std::path::Path::new(path.as_slice()))) {
|
match result(|| File::open(&std::path::Path::init(path.as_slice()))) {
|
||||||
Ok(fd) => return Some(~fd as ~Reader),
|
Ok(fd) => return Some(~fd as ~Reader),
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
writeln!(&mut stderr() as &mut Writer,
|
writeln!(&mut stderr() as &mut Writer,
|
||||||
|
|
8
wc/wc.rs
8
wc/wc.rs
|
@ -121,12 +121,12 @@ pub fn wc(files: ~[~str], matches: &Matches) {
|
||||||
// try and convert the bytes to UTF-8 first
|
// try and convert the bytes to UTF-8 first
|
||||||
match from_utf8_slice_opt(raw_line) {
|
match from_utf8_slice_opt(raw_line) {
|
||||||
Some(line) => {
|
Some(line) => {
|
||||||
word_count += line.word_iter().len();
|
word_count += line.words().len();
|
||||||
current_char_count = line.iter().len();
|
current_char_count = line.chars().len();
|
||||||
char_count += current_char_count;
|
char_count += current_char_count;
|
||||||
},
|
},
|
||||||
None => {
|
None => {
|
||||||
word_count += raw_line.split_iter(|&x| is_word_seperator(x)).len();
|
word_count += raw_line.split(|&x| is_word_seperator(x)).len();
|
||||||
for byte in raw_line.iter() {
|
for byte in raw_line.iter() {
|
||||||
match byte.is_ascii() {
|
match byte.is_ascii() {
|
||||||
true => {
|
true => {
|
||||||
|
@ -221,7 +221,7 @@ fn open(path: ~str) -> Option<BufferedReader<~Reader>> {
|
||||||
return Some(BufferedReader::new(reader));
|
return Some(BufferedReader::new(reader));
|
||||||
}
|
}
|
||||||
|
|
||||||
match result(|| File::open(&std::path::Path::new(path.as_slice()))) {
|
match result(|| File::open(&std::path::Path::init(path.as_slice()))) {
|
||||||
Ok(fd) => {
|
Ok(fd) => {
|
||||||
let reader = ~fd as ~Reader;
|
let reader = ~fd as ~Reader;
|
||||||
return Some(BufferedReader::new(reader));
|
return Some(BufferedReader::new(reader));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue