Update README

This commit is contained in:
2022-05-08 20:27:18 +02:00
parent e9fe9f7cb2
commit 8309272f1c
2 changed files with 13 additions and 2 deletions

View File

@@ -1,3 +1,14 @@
# latex-acronym-sort # latex-acronym-sort
Auto sorter for the latex acronym package 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 <filepath>
```

View File

@@ -6,7 +6,7 @@ fn main() -> Result<(), Error> {
let args = Args::parse(); let args = Args::parse();
let wordlist = read_to_string(&args.filepath)?; 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 lowerbound = list.iter().position(|&x| x.contains("\\begin{acronym}"));
let upperbound = list.iter().position(|&x| x.contains("\\end{acronym}")); let upperbound = list.iter().position(|&x| x.contains("\\end{acronym}"));