uutils/coreutils — pull request #234 by polyphemus (2014-06-13 19:36:13+00:00)
Title: Implement cut - implement #165

This pull adds the `cut` command. When complete it should fix issue #165.

Currently it lacks support for the `-f`/`--fields` option. I will work on it in the upcoming days.

The `-c`/`--characters` option uses `rust`'s underlying definition of a character as a utf-8 sequence. This differs with `cut` behaviour for GNU coreutils, which simply implements `-c`/`--characters` as an alias for `-b`/`--bytes`.

Currently the program just `fail`s if it encounters a non-utf-8 sequence. The program should show an error, but seeing as the behaviour does already differ from GNU `cut` any suggesting on the handling of characters as utf-8 sequences are welcome.

The performance is not as good as I had hoped. I already switched from a idiomatic approach with iterators to a more C-like implementation, which did double the performance, but it is still an order of magnitude slower than GNU `cut`. Again, any suggestions on this front would be very much appreciated.