Commit graph

543 commits

Author SHA1 Message Date
Mariano Casco
79d281394f tail: -f option on stdin
The follow() function takes slices instead of the actual vectors, and in
the case of unbounded_tail the single bufReader is on stdin.
2016-05-31 12:37:03 -03:00
Mariano Casco
fafab00cd8 tail: remove extra println 2016-05-31 10:52:53 -03:00
Mariano Casco
f9627e02d0 tail: print empty line between headers 2016-05-30 17:33:16 -03:00
Mariano Casco
440fb867bc tail: no headers when following a single file
Headers should only be printed when following more than one file. This
commit makes the test_follow() test pass again.
2016-05-30 16:43:14 -03:00
Mariano Casco
8866e05e98 tail: print headers when following multiple files
Before each line of content is printed, check if it's from a different
file than the last one we printed for. If so, print a '==> file <=='
header to separate the output in the way tail does.
2016-05-30 16:12:00 -03:00
Mariano Casco
966bfde70f tail: follow multiple files
If multiple files are passed as arguments with the -f option, a vector
of BufReaders is built as the files are first tailed, so that follow()
can take control for the rest of the time the program is running.

follow() loops over each reader and prints all new available content on
each file before moving on to the next.
2016-05-30 16:11:49 -03:00
Mariano Casco
2132889940 tail: don't follow() as part of bounded_tail
To get the -f option to follow multiple files, bounded_tail should just
tail a single file and return, instead of blocking processing of other
files by calling follow() (which loops forever).
2016-05-30 16:11:32 -03:00
Tshepang Lekhonkhobe
1476446ddf remove compiler warnings 2016-05-24 22:30:48 +02:00
Nathan Ross
e827e80a9f cksum: resolve msvc unsafe issue
Fixes #886
2016-05-23 22:06:37 -04:00
Heather
145f2efe89 Merge pull request #885 from jbcrail/refactor-tests
Refactor and fix tests
2016-05-23 09:35:34 +04:00
Christopher Ian Stern
e909e665f0 od: take more format options, respect their order. 2016-05-22 15:46:20 -05:00
Joseph Crail
af6c88f676 mktemp: fix whitespace 2016-05-22 16:41:36 -04:00
Joseph Crail
b132f65126 mktemp: build standalone executable 2016-05-22 16:41:36 -04:00
Joseph Crail
b50fc88ead mktemp: use tempfile crate from crates.io 2016-05-22 16:41:36 -04:00
Heather
bdc1ca7426 Merge pull request #882 from jbcrail/fix-windows-build
Improve Windows build
2016-05-22 16:02:03 +04:00
ibabushkin
d504ae18c9 pathchk implemented (see #841) (#860)
* Added pathchk
2016-05-22 15:59:57 +04:00
Joseph Crail
d4994233c7 whoami: remove unused import 2016-05-22 04:39:02 -04:00
Heather
583ed341a7 Merge pull request #880 from knight42/fix
Fix #879
2016-05-21 18:08:35 +04:00
Knight
a196bebd1b uucore: add disp_err macro 2016-05-21 18:19:13 +08:00
Knight
aac1d40f64 dircolors: bypass the missing SHELL on windows 2016-05-21 18:18:40 +08:00
Joseph Crail
cd89a6e5c7 tr: update vec_map to 0.6.0
Fixes #865
2016-05-14 22:56:24 -04:00
Heather
ca78706246 Merge pull request #875 from knight42/dircolors
Implement dircolors
2016-05-10 22:18:40 +04:00
Knight
ad9bfcef5b dircolors: implemented
TODO: More test case
2016-05-11 00:43:51 +08:00
Knight
c9f363d09c Add dircolors 2016-05-11 00:43:51 +08:00
Knight
6592e0308c mknod: use libc@0.2.4 to avoid unresolved name 2016-05-08 16:24:11 +08:00
Knight
78f9351e71 mknod: correct the help 2016-05-07 16:12:01 +08:00
Knight
467561da36 mknod: implemented 2016-05-07 15:21:37 +08:00
Knight
79478626da add mknod 2016-05-07 15:21:37 +08:00
Heather
1fafde8c27 Merge pull request #845 from peschkaj/master
Basic implementation of ls
2016-05-01 00:56:11 +04:00
Heather
f47fafb28d Merge pull request #830 from lucaotta/fix-788
Fix #788
2016-05-01 00:41:15 +04:00
Heather
57693af48d Merge pull request #871 from modelorganism/odupdate
add functionality to od
2016-05-01 00:34:24 +04:00
modelorganism
3f356a4190 od: take input from stdin, as well as files. 2016-04-26 23:17:00 -05:00
modelorganism
e6cf167d1d od: Accept multiple files names as input 2016-04-25 21:55:34 -05:00
modelorganism
1fbda9663d Add extra spaces to output to match formating of origial od 2016-04-25 21:47:24 -05:00
Mike Swanson
c946202094 hashsum: add support for SHA-3 functions
Only the fixed output-size functions are supported, SHAKE128 and
SHAKE256 are not included for now.
2016-04-16 06:17:15 -07:00
Michael Gehring
77d1c309cd od: fix infinite loop at EOF
Fixes #866
2016-04-15 07:41:03 +02:00
Nick Fitzgerald
3972c6eb53 tail: Clean up and test suffix multiplier
Makes `parse_size` return a `Result` where the `Err` part indicates whether
there was a parsing error, or the parse size is too big to store. Also makes the
value parsed a `u64` rather than a `usize`.

Adds unit tests for `parse_size` and integration tests using the suffix
multiplier in a number passed with the `-n` flag.
2016-04-02 14:16:11 -07:00
Valentin Lorentz
2fd7164cda tail: Implement tail -z.
This options makes tail use NULL instead of newline as a line
delimiter.
2016-04-02 12:32:33 +02:00
Luca Ottaviano
6ded76714b chmod: remove unused dependencies 2016-04-02 10:29:57 +02:00
Luca Ottaviano
2686ea75d7 chmod: handle -octal and -[rwx]
The main issue is that -octal or -[rwx] is interpreted as an option by
getopts.
Search the args for such a pattern, remove it before parsing and
manually handle it afterwards.
Fixes #788.
2016-04-02 10:29:57 +02:00
Nick Fitzgerald
2b2c2b64c2 tail: When tailing a file in bytes mode, seek directly to the specified byte
When tailing a file, as opposed to stdin, and we are tailing bytes rather than
lines, we can seek the requested number of bytes from the end of the file. This
side steps the whole `backwards_thru_file` file loop and blocks of reads.

Fixes #833.
2016-03-27 14:34:58 -07:00
Nick Fitzgerald
f851611001 tail: Pre-fill the buffer with zeroes
Rather than fill the buffer on every file read iteration, pre-fill it with
zeroes once at initialization time.
2016-03-27 14:34:58 -07:00
Jeremiah Peschka
e7458b6086 Fixing trailing semicolon in display_permissions 2016-03-25 18:43:43 -07:00
Jeremiah Peschka
539da3ba1a Changed display_symlink_count to use the right variable name. Removed dead code. 2016-03-25 16:36:34 -07:00
Jeremiah Peschka
0bb0c40c36 Adding tests for ls. Corrected issue with ls on the present directory throwing panic!() 2016-03-25 14:25:52 -07:00
Jeremiah Peschka
825a850fa9 Wishing I could spell my own name. 2016-03-25 14:18:23 -07:00
Jeremiah Peschka
9716862cfe Adding skeleton of ls 2016-03-25 14:00:27 -07:00
Joseph Crail
491320747b sort: remove explicit enum values 2016-03-25 16:55:58 -04:00
Joseph Crail
2cdccb10bb sort: fix whitespace and spelling 2016-03-25 16:55:58 -04:00
Joseph Crail
cc63565051 sort: add month sort 2016-03-25 16:55:58 -04:00