Skip to content

Commit

Permalink
Use posix compliant tail syntax
Browse files Browse the repository at this point in the history
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
```
  • Loading branch information
jlec authored and chris-araman committed Nov 2, 2021
1 parent 8c0267d commit 7fe27fc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/completion/mas-completion.bash
Expand Up @@ -9,7 +9,7 @@ _mas() {
_get_comp_words_by_ref cur prev words cword
fi
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
fi
}
Expand Down

0 comments on commit 7fe27fc

Please sign in to comment.