Commit graph

29 commits

Author SHA1 Message Date
Wim Hueskes
3e143217a9 od: refactor sign_extend
easier to understand algoritm which does not use unsafe
2016-09-01 00:01:55 +02:00
Wim Hueskes
e0b7ff1953 od: implement --help and --version 2016-09-01 00:01:35 +02:00
Christopher Ian Stern
e909e665f0 od: take more format options, respect their order. 2016-05-22 15:46:20 -05: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
Michael Gehring
77d1c309cd od: fix infinite loop at EOF
Fixes #866
2016-04-15 07:41:03 +02:00
Joseph Crail
b90d253584 Refactor and simplify build for utilities.
For coreutils, there are two build artifacts:

  1. multicall executable (each utility is a separate static library)
  2. individual utilities (still separate library with main wrapper)

To avoid namespace collision, each utility crate is defined as
"uu_{CMD}". The end user only sees the original utility name. This
simplifies build.rs.

Also, the thin wrapper for the main() function is no longer contained in
the crate. It has been separated into a dedicated file. This was
necessary to work around Cargo's need for the crate name attribute to
match the name in the respective Cargo.toml.
2015-12-07 21:56:45 -05:00
Nathan Ross
502957dc3e use cargo idioms to manage dependency resolution and compilation 2015-11-23 02:04:15 -05:00
Carlos Liam
87d14978e9 Clean whitespace
Remove leading newlines and replace lines containing only whitespace
with empty lines
2015-10-06 12:04:46 -04:00
Michael Gehring
9d8abbcb06 Basic Cargo build
Builds the uutils multicall binary containing all utils (except stdbuf)
by default. To only build a subset
    `cargo --no-default-features --features <utils>`
can be used.

Whats missing is building the standalone binaries and a mechanism to
automatically disable the build of unix only utils on windows.
2015-08-28 21:12:30 +02:00
Joseph Crail
b4b08de42c Switch to external getopts cargo (part 1).
I switched over to the getopts crate on crates.io, instead of Rust's
private implementation. This will allow coreutils to build for Rust 1.0.

I'm splitting the updates into several commits for better reviewing.
2015-05-20 22:47:30 -04:00
Joseph Crail
b20bde94cb Fix od.
I upgraded to the nightly build and replaced the unstable BYTES constant
with mem::size_of().
2015-05-11 00:48:36 -04:00
Michael Gehring
9f8fd55b4a Integer type changes 2015-03-08 19:06:30 +01:00
Michael Gehring
9ae9a48387 feature io -> old_io, path -> old_path 2015-02-22 13:59:12 +01:00
Michael Gehring
e7b647171f os::set_exit_status(isize) -> env::set_exit_status(i32) 2015-02-22 13:59:12 +01:00
Michael Gehring
3eb5a814a3 Fix most unstable feature warnings 2015-02-03 23:54:37 +01:00
Michael Gehring
db8506532e derive(Show) -> derive(Debug) 2015-02-03 22:42:36 +01:00
Alex Lyon
9c0ed7236c Merge pull request #517 from keunwoo/keunwoo-fix-address-radix-20150127
od: fix --address-radix interpretation and minor cleanups
2015-02-01 12:13:37 -08:00
Michael Gehring
d187dc574b std::io -> std::old_io 2015-01-29 08:45:37 +01:00
Keunwoo Lee
f6a07663e8 od: proper interpretation of -A flag
Prior to this CL, --address-radix was being used to determine the format
of the output bytes.  This was wrong: this flag controls the printing of
the address (in the POSIX spec for od, this is called the "input offset
base"), not the printing of the content bytes.
2015-01-27 21:51:28 -08:00
Keunwoo Lee
55be34a2c4 od: clean up fname usage
+ rm superfluous clone
+ rm superfluous mut variable
2015-01-27 21:51:28 -08:00
Keunwoo Lee
71bc68a987 od: rm -v alias for --version
This shortflag conflicts with --output-duplicates.
2015-01-27 21:51:28 -08:00
Keunwoo Lee
b756a57345 od: clean up parse_radix code and use site
+ Make parse_radix terser and clearer.
+ Make purpose of radix clearer at use site
  (note that the code currently completely misuses the --address-radix
  flag; this is inherited from the previous code)
+ Don't panic! inside parse_radix; instead return Result<> and let the
  caller handle errors (currently we panic, but probably we'll want to use
  some less alarming error routine); this will be more testable later as
  well.
2015-01-27 21:51:28 -08:00
Keunwoo Lee
288179be49 address Arcterus comments on uutils/coreutils PR 515
Mostly style things.
2015-01-27 19:32:26 -08:00
Keunwoo Lee
1954274700 od: fix warnings 2015-01-25 00:17:38 -08:00
Keunwoo Lee
a6e5deaa16 od: whitespace fix (4-space indents, 99-column) 2015-01-25 00:03:14 -08:00
Keunwoo Lee
2d8e7f6dec od: fix build
Just the minimal stuff needed to make od build again.  I have restrained
myself from making more invasive changes.
2015-01-24 23:56:10 -08:00
Keunwoo Lee
3739c82c95 mv od/ -> src/ 2015-01-24 23:16:13 -08:00