alphapapa / alphapapa/with-emacs.sh

Does not work with default Mac `getopt` version

Đang mở
#3 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
documentation help wanted
Ngôn ngữ chính
Shell
Star
174
Fork
16
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

The Mac `getopt` is unable to parse long options and uses a slightly different syntax. I need to test this on a linux box, but I believe the following change will be sufficient.

```
getopt -T > /dev/null
if [ $? -eq 4 ]; then
# GNU enhanced getopt available with long options
args=$(getopt -n "$0" -o d:hi:OPR -l dir:,debug,help,install:,no-package,no-org-repo,no-refresh-packages -- "$@") || { usage; exit 1; }

else
# Mac/BSD version
args=$(getopt d:hi:OPR "$*")
fi
eval set -- "$args"
```

I did need to change the `while [true]` to `while [ $# -gt 0 ];` at the top of the argument processing loop as well. I did have some trouble passing on arguments to emacs in the `$rest` variable, but it does let me quickly setup a sandbox.

Of course the other option is to just install `getopt` from homebrew, and this would all be moot :)

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.