Commit graph

113 commits

Author SHA1 Message Date
Kian-Meng Ang
b9ab07470f Fix typos and markdowns
See a detailed description of the rules is available at
https://github.com/markdownlint/markdownlint/blob/master/docs/RULES.md #
Please enter the commit message for your changes. Lines starting
2022-09-16 16:11:10 -04:00
Ryan Geary
d434bd289d Create version 1.3.4 2022-04-23 18:32:34 -04:00
Ryan Geary
0400bf6ce4 Fix field separator issue with no EOF 2022-04-23 18:19:10 -04:00
Ryan Geary
bd32530e84 Fix positive start, negative end, length 1 choice is empty 2022-04-23 17:26:21 -04:00
Paul Moore
97b3abf520 Rename test files for Windows compatibility 2022-04-18 09:00:24 -04:00
Herby Gillot
1708d588d7 README: add MacPorts install info
`choose` is available via MacPorts: https://ports.macports.org/port/choose/
2021-12-16 17:56:14 -05:00
Ryan Geary
cd71501b72 Create version 1.3.3
Fixes a bug that occurs when the input is an empty line and a negative
choice is used, causing `choose` to crash
2021-07-26 20:40:50 -04:00
Ryan Geary
1970d0cc74 Improve error handling
Create choose::Error and choose::Result
Improve error propogation
Improve error printing

Add tests for negative indices
Add get_negative_start_end tests
Fixup negative choice indexing

Remove most uses of unwrap

Fixes #38
2021-07-23 16:27:02 -04:00
Ryan Geary
03e5ca4c1d Bump to version 1.3.2 2021-07-12 21:28:14 -04:00
Ryan Geary
4c30976bf4 Apply clippy suggestions 2021-07-12 21:22:53 -04:00
Ryan Geary
e31a1f1c04 Update github workflows 2021-07-12 21:22:40 -04:00
Ryan Geary
3f147da84c Apply clippy suggestions 2021-07-12 20:16:27 -04:00
Ryan Geary
b4af4ef2c2 Propogate BrokenPipe error up to main and exit gracefully 2021-07-12 20:16:27 -04:00
Ryan Geary
abde65491b Add GitHub action to create GitHub release 2020-08-16 09:36:40 -04:00
Ryan Geary
064efa3fcb Bump to version 1.3.1 2020-08-13 17:51:05 -04:00
Ryan Geary
76461e0a1d Fix blank line getting printed with field_separator
This changes the onus of removing trailing newlines when it matters to
the caller to print_choice.
2020-08-13 17:43:16 -04:00
Ryan Geary
5981201700 Move make release rule to be default 2020-08-13 17:42:44 -04:00
Ryan Geary
1dc35e8cd7 Bump to version 1.3.0 2020-06-26 16:31:14 -04:00
Collin Reilly Clark
05739d0146 add brew package to readme.md
closes #21
2020-06-26 16:24:36 -04:00
Ryan Geary
710b95e866 Use LineWriter when input is stdin (#10) 2020-06-24 22:27:03 -04:00
Ryan Geary
2ee77aa848 Move backslash escaping to separate crate 2020-06-17 20:50:49 -04:00
Ryan Geary
767b9303f2 Add backslash escape parsing (#26) 2020-06-17 19:24:05 -04:00
Ryan Geary
0e422090d3 Add crates.io GitHub action 2020-06-16 20:03:07 -04:00
Ryan Geary
04af6f2304 Add one_indexed flag (#23) 2020-06-15 20:50:30 -04:00
Ryan Geary
152b4fb77d Bump version to 1.2.0 2020-06-08 23:23:33 -04:00
Ryan Geary
fc6a2ddbda Add regression tests for #16 2020-06-08 22:52:47 -04:00
Ryan Geary
263f64e674 Create rust.yml 2020-06-08 22:29:04 -04:00
Ryan Geary
1ee01c6de0 Add alternate Rust-y range syntax (#11)
Refactor to support choice 'kind'

Add ParseRangeError

Add rust syntax range parsing tests

Implement rust syntax parsing

Change parse to not anticipate exclusivity

Add choice tests

Implement Rust syntax choices

Show that there are multiple in opt.choice*s*

Refactor repeated code in choice tests

Update documentation to reflect Rust range syntax
2020-06-08 22:16:02 -04:00
Ryan Geary
63b9eea62c Fix readme exclusivity mistake
fixes #14
2020-06-08 11:20:25 -04:00
Ryan Geary
dfbeb102bb Add CONTRIBUTING.md 2020-06-08 11:10:03 -04:00
Ryan Geary
0cd42bb4fb Prepare for crates.io release 2020-06-07 23:15:44 -04:00
Ryan Geary
18b3440bec Add license line to Cargo 2020-06-07 16:53:22 -04:00
Ryan Geary
5d65fb99ce Add updated documentation 2020-06-02 15:09:00 -04:00
Ryan Geary
588ff3ef1b Advance to v1.1.0 2020-06-02 15:02:48 -04:00
Ryan Geary
a66621380b Add character-wise chooseing
Alphabetize structopt options

Add character-wise tests

Add character-wise switch

Add print-after-end test

Add empty default separator for char-wise mode

Add char-wise forward and negative printing

Add pure reverse printing

Change to char_wise to user `char` instead of `u8`

Adds support for unicode (read: emojis)

Adds a newline char to end of each char-wise test because that's how it
is

Add writing traits for better code structure

Merge repetitive codepaths with generics

Unify print_choice_* funtion names

Reorder functions in choice module

Rename variable to avoid name confusion

Make default case for loop more readable

Abstract default case print loop

Add e2e test

Move vec create to print_choice_negative
2020-06-02 14:41:30 -04:00
Ryan Geary
5f77249672 Add Arch Linux installation to readme 2020-04-13 13:45:30 -04:00
Ryan Geary
7243843d2f [FEATURE] specify output field delimiter (#8)
Add output_field_separator option

Add output_field_separator tests

Change structopt req to 0.3

Separate negative choices into a function

Prevent tail printing output_field_separator

Change OFS to Option<String> with a default value of " "

Reorder arguments to write_bytes to parallel print_choice

Print output_separator in main loop if applicable

Add `cargo test` to Makefile

Add write_separator function
2020-04-06 17:13:57 -04:00
Ryan Geary
d40c9d5234 Non-greedy String Splitting (#7)
* Add non_greedy flag

* Add non-greedy tests

* Prevent printing spaces for empty fields

* Prevent filtering non-empty fields when non-greedy
2020-04-04 18:09:37 -04:00
Artem Polishchuk
024edfc8f4 Update readme.md 2020-04-04 18:02:11 -04:00
Artem Polishchuk
4d78788eb5 Add packaging status 2020-04-04 18:02:11 -04:00
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