I have a tex document spanning several files that I want to check with aspell. The command I use is:
cat $f | aspell list --extra-dicts="./names.spl" --mode=tex -l en |sort -u
for every file name f.
Some files that concern pronunciation have "words" like aj and oo inside them, which aspell counts as spelling mistakes. I want to filter them out without putting them into the names.spl dictionary. (first because they are not names, second because they shouldn't be ignored in other files)
the aspell documentation states that the "extra-dicts" argument can receive a list, but I can't seem to delimit it properly. I tried , : and plain spaces to no avail. They are either treated as a long file path or get entirely separated from the extra-dicts keywords.
I also tried to use the option twice, but the second time just overrides the first.
Am I missing something trivial about how lists are provided as command line arguments in the terminal?
According to the texinfo manual (info aspell
), aspell
uses a list option format that is different from other GNU programs, in which the base option name is prefixed with add-
or rem-
to respectively add or remove items from a list:
4.1.1.3 List options ....................
To add a value to the list, prefix the option name with an 'add-' and then specify the value to add. For example, to add the URL filter use '--add-filter url'. To remove a value from a list option, prefix the option name with a 'rem-' and then specify the value to remove. For example, to remove the URL filter use '--rem-filter url'. To remove all items from a list prefix the option name with a 'clear-' without specify any value. For example, to remove all filters use '--clear-filter'.
Following this pattern for the --extra-dicts
option, you would add multiple extra dictionaries as
--add-extra-dicts dict1 --add-extra-dicts dict2
The documentation for Aspell 0.60.7-20110707
also mentions a (possibly newer) more direct delimited list format, using a third prefix lset
:
A list option can also be set directly, in which case it will be set to a single value. To directly set a list option to multiple values prefix the option name with a 'lset-' and separate each value with a ':'. For example, to use the URL and TeX filter use '--lset-filter url:tex'.
Following this format, your option would become
--lset-extra-dicts dict1:dict2