diff options
| author | Teddy Wing | 2016-04-06 12:39:16 -0400 |
|---|---|---|
| committer | Teddy Wing | 2016-04-06 12:39:16 -0400 |
| commit | cad8246ab54f7c81b70d1445ccac356bc4b06d02 (patch) | |
| tree | abf70f99de2910f719486a582df34004181fb9a9 /testdata | |
| parent | 02688030cb7b1de5c63732b8b820017391bfd2a0 (diff) | |
| download | mutt-alias-auto-add-cad8246ab54f7c81b70d1445ccac356bc4b06d02.tar.bz2 | |
Implement `build_alias`
Copy of the functionality in W. Caleb McDaniel's Bash script implemented
in Rust:
echo "${MESSAGE}" | grep ^"From: " | sed s/[\,\"\']//g | awk '{$1=""; if (NF == 3) {print "alias" $0;} else if (NF == 2) {print "alias" $0 $0;} else if (NF > 3) {print "alias", tolower($(NF-1))"-"tolower($2) $0;}}'
Doesn't currently include the [,"'] filtering.
Added a couple of new test cases to cover other address formats.
Not sure if I should use `if..else if` here or a `match`. I feel like I
should return an empty string at the end if we can't build an alias
line.
Diffstat (limited to 'testdata')
0 files changed, 0 insertions, 0 deletions
