Commit graph

123 commits

Author SHA1 Message Date
Ryan Geary
6dc46adb8b Move Cargo.toml to v1.0.0 2020-04-04 13:44:18 -04:00
Ryan Geary
fabb9ced5e
Create LICENSE 2020-04-02 21:27:13 -04:00
Ryan Geary
9bf02141f3 Fix documentation inconsistency 2020-04-02 15:25:47 -04:00
Ryan Geary
b0aa310c83 Update documentation for v0.1.4 2020-04-02 10:14:29 -04:00
Ryan Geary
e78ea2783c Add negative choice and parsing tests
Allow negative ranges as long as they aren't reversed too

Allow reversed negative ranges iff both indices are negative
2020-04-01 13:15:32 -04:00
Ryan Geary
a90a5cb742 Cargo fmt 2020-03-17 13:44:14 -04:00
Ryan Geary
41e060680e Handle failure to open input file 2020-03-17 13:43:49 -04:00
Ryan Geary
dfe4c2cad0 Reassign exit codes and clean up e2e_test
0 - Success
1 - Argument parsing error
2 - Regex compilation error
2020-03-17 13:26:35 -04:00
Ryan Geary
5b5fa0ed7a Use debuginfo only for flamegraph builds 2020-03-16 19:56:07 -04:00
Ryan Geary
47c9c73c4b Separate Opt into separate mod 2020-03-15 19:40:41 -04:00
Ryan Geary
f87a3f1658 Use lazy_static for parse_choice regex 2020-03-15 16:30:59 -04:00
Ryan Geary
afb4bf4734 Return ParseIntErrors from parse_choice 2020-03-15 16:14:17 -04:00
Ryan Geary
81589d8aab Remove lingering flame_it cfg 2020-03-15 14:51:26 -04:00
Ryan Geary
c81efcf42f Add custom BufReader to cut down on allocation time 2020-03-15 14:46:50 -04:00
Ryan Geary
dfc95865d4 Add test and bench rules to Makefile 2020-03-15 14:45:32 -04:00
Ryan Geary
b6d3e4ba5a Add error messages for stdout writes 2020-03-14 23:02:31 -04:00
Ryan Geary
94085bb302 Make regex compilation errors more specific 2020-03-14 22:20:52 -04:00
Ryan Geary
59ada49afd Set version=0.1.3 2020-03-10 00:23:04 -04:00
Ryan Geary
389c29822b Improve performance and add profiling tooling
Add tags, todo, *.bench, *.svg and bench_output to .gitignore

Add test/bench.sh script. bench.sh runs the `bench` command on each
test/long*txt file with range 3:5 and saves the output to a file for
comparing performance across file sizes.

Inline printing in get_choice_slice

Change BufWriter<..stdout..> to BufWriter<T>

Add MockStdout for testing printing

Add more reverse range tests

Simplify word finding with a more uniform bounds check.

Add Makefile for generating flamegraphs

Redefine Choice struct as a start and end integer

Improve algorithm for finding words to print

Settle exclusivity at Config construction time

Add tests for nonexistant field_seps

Add regression test for preceding separator

Use handle.write instead of write! macro for tremendous speed up
2020-03-10 00:03:14 -04:00
Ryan Geary
c729ad3f00 RustFmt 2019-10-24 21:05:09 -04:00
Ryan Geary
f662219407 [BREAKING] Default to inclusive ranges, -x for exclusive 2019-10-13 22:00:15 -04:00
Ryan Geary
0be16bf1d9 Add reverse ranges 2019-10-13 21:40:59 -04:00
Ryan Geary
e7169ea2e8 Add print_out_of_order test 2019-10-13 20:32:00 -04:00
Ryan Geary
c204f99444 Reorganize massively 2019-10-10 21:24:07 -04:00
Ryan Geary
f722cbcbbb Remove repeated Regex compilation 2019-10-09 18:23:02 -04:00
Ryan Geary
09ddbb4f65 Use BufWriter and write(ln)! instead of print(ln)! 2019-09-29 23:10:33 -04:00
Ryan Geary
ba26c1f42d Stop collecting lines of stdin 2019-09-29 23:10:14 -04:00
Ryan Geary
0b1a59ad2a Bump version in Cargo.toml 2019-09-29 17:52:20 -04:00
Ryan Geary
e28bdcce12 Add cargo test to e2etest 2019-09-17 23:48:59 -04:00
Ryan Geary
5c96955257 Add a bunch of get_choice_slice tests 2019-09-17 23:40:35 -04:00
Ryan Geary
4afdc50158 Separate slice finding from printing 2019-09-17 23:40:35 -04:00
Ryan Geary
5703ed02a1 Move parse_choice tests into their own test module 2019-09-17 23:40:35 -04:00
Ryan Geary
55ac2acc8e Add future tests 2019-09-17 23:40:35 -04:00
Ryan Geary
c81af46d4e Add successful parsing tests 2019-09-17 23:40:35 -04:00
Ryan Geary
4eb2ed0396 Test return value on error with e2e test 2019-09-17 23:40:35 -04:00
Ryan Geary
e668d9f508 Add first test 2019-09-17 23:40:35 -04:00
Ryan Geary
fd66e3cfb7 Move most of the processing out of main 2019-09-17 23:40:30 -04:00
Ryan Geary
6c889b3963 Add compilation instructions 2019-09-17 22:06:04 -04:00
Collin Reilly Clark
d226c750ef separate examples to make explanations easier to digest visually 2019-09-16 18:30:56 -04:00
Ryan Geary
2f590f61c9 Update readme 2019-09-11 23:21:26 -04:00
Ryan Geary
49b88bd0be Convert panic!s to eprintln!s and add exit stati 2019-09-11 22:55:32 -04:00
Ryan Geary
da7a536fa6 Add regex matching with field separator 2019-09-11 22:14:57 -04:00
Ryan Geary
5a5a77e88f Unify enumerating lines in print_choice 2019-09-11 11:52:20 -04:00
Ryan Geary
18dcf845fb Add choose 12 test 2019-09-11 11:50:49 -04:00
Ryan Geary
44e5446992 Rename test to e2e_test 2019-09-10 23:51:59 -04:00
Ryan Geary
1d4fd6f48e Ignore all whitespace in testing 2019-09-10 23:51:21 -04:00
Ryan Geary
e7197092b5 Validate vector indeces 2019-09-10 23:51:01 -04:00
Ryan Geary
4b6d44e121 Add basic test suite 2019-09-10 23:36:39 -04:00
Ryan Geary
ddf563d41b Allow for inclusive ranges and move choice parsing into Choice enum 2019-09-10 22:15:57 -04:00
Ryan Geary
8a430e0fdf Update choice help document 2019-09-10 22:14:42 -04:00