Use posix compliant tail syntax

homebrew allows using gnu coreutils on MacOS. Therefore we should
comply with posix standards

```bash
$ mas help | tail +3
tail: cannot open '+3' for reading: No such file or directory
$ type tail
tail is /usr/local/opt/coreutils/libexec/gnubin/tail
```

Switching to posix compliant `-n` syntax is compatible with UNIX and GNU tooling.

```bash
$ mas help | /usr/bin/tail -n +3 | wc -l
18
$ mas help | tail -n +3 | wc -l
18
```
This commit is contained in:
Justin Lecher 2021-09-28 20:59:01 +01:00 committed by Chris Araman
parent 8c0267da3d
commit 7fe27fc693

View file

@ -9,7 +9,7 @@ _mas() {
_get_comp_words_by_ref cur prev words cword _get_comp_words_by_ref cur prev words cword
fi fi
if [[ $cword -eq 1 ]]; then if [[ $cword -eq 1 ]]; then
COMPREPLY=($(compgen -W "$(mas help | tail +3 | awk '{print $1}')" -- "$cur")) COMPREPLY=($(compgen -W "$(mas help | tail -n +3 | awk '{print $1}')" -- "$cur"))
return 0 return 0
fi fi
} }