plyint / encpass.sh

Lightweight solution for using encrypted passwords in shell scripts
MIT License
598 stars 43 forks source link

help command doesn't work in macOS #19

Closed russelldavis closed 4 years ago

russelldavis commented 4 years ago

The man command in macOS doesn't support the -l option.

$ encpass.sh help
man: invalid option -- l
man, version 1.6g

usage: man [-adfhktwW] [section] [-M path] [-P pager] [-S list]
    [-m system] [-p string] name ...
ahnick commented 4 years ago

@russelldavis Thanks for this. I had assumed (incorrectly) this was a standard flag across man implementations. Does macOS use a different flag or is there a typical workaround you are aware of? If not, then I think I can fallback to stripping the man page formatting and outputting to less.

russelldavis commented 4 years ago

Unfortunately I don't see any equivalent flag. I'm guessing there's probably a workaround, but nothing jumps out at me right away. For reference, the manpage is here: https://www.unix.com/man-page/osx/1/man

ahnick commented 4 years ago

@russelldavis I just pushed a branch called "help" (https://github.com/plyint/encpass.sh/tree/help) to attempt to emulate what man does when the -l option is not available. It should also strip the formatting and directly output to less if man is missing on the system.

If you have a moment and wouldn't mind pulling the branch down and testing on Mac I'd appreciate it. Thanks.

russelldavis commented 4 years ago

Just tried it, works great! Thanks.

ahnick commented 4 years ago

Great, thanks for confirming. I have pushed to master and published a new release. Marking as closed.