From 8309272f1c20f07cae71e4aa29ac1059b74a9f10 Mon Sep 17 00:00:00 2001 From: structix Date: Sun, 8 May 2022 20:27:18 +0200 Subject: [PATCH] Update README --- README.md | 13 ++++++++++++- src/main.rs | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 64c88d8..71e2391 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,14 @@ # latex-acronym-sort -Auto sorter for the latex acronym package \ No newline at end of file +Auto sorter for the latex acronym package + +## Build +Run the following command to build this project: +```shell +cargo build -r +``` + +## Usage +```shell +latex-acronym-sort -f +``` \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index a230765..976d142 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,7 +6,7 @@ fn main() -> Result<(), Error> { let args = Args::parse(); let wordlist = read_to_string(&args.filepath)?; - let mut list: Vec<&str> = wordlist.split_ascii_whitespace().collect(); + let mut list: Vec<&str> = wordlist.split("\n").collect(); let lowerbound = list.iter().position(|&x| x.contains("\\begin{acronym}")); let upperbound = list.iter().position(|&x| x.contains("\\end{acronym}"));