Commit Graph

6 Commits

Author SHA1 Message Date
balatt
0d471266ce wc: Rewritten with added features (#690)
Now gets a true byte count by using the file size.

* When giving a single-line string without a trailing newline, the line
  count should not go up ('printf "test" | wc -l' should output '0')

* Doesn't hang up when using two or more switch options in a row.
  (It would hang if I did 'wc -lw test.frm').

  While mine works with multiple args like that, they don't switch
  anything, you have to do wc -l -w etc but I think that is an issue
  with CArgsParser.

* It can now take standard input without needing a "-".

* When encountering a file that doesn't exist, it doesn't exit.

  It prints the counts for each file that does, and prints an error to
  stderr for each file that doesn't. 

* Has slight buffering between counts to be closer to GNU and BSD wc.
2019-11-04 12:42:30 +01:00
Tim Morgan
bc23db2c71 Add stdin support to wc program 2019-09-12 07:47:19 +02:00
Andreas Kling
73fdbba59c AK: Rename <AK/AKString.h> to <AK/String.h>
This was a workaround to be able to build on case-insensitive file
systems where it might get confused about <string.h> vs <String.h>.

Let's just not support building that way, so String.h can have an
objectively nicer name. :^)
2019-09-06 15:36:54 +02:00
Andreas Kling
127e1e0077 wc: Add missing newlines to some error messages 2019-09-01 15:32:09 +02:00
Andreas Kling
5980007e44 Userland: Fix many compiler warnings. 2019-06-22 15:47:08 +02:00
Callum Attryde
267672efee Userland: Add wc program (#228)
Fixes #159.
2019-06-16 14:13:57 +02:00