hledger icon indicating copy to clipboard operation
hledger copied to clipboard

hledger help TOPIC works less well with older info / on mac

Open simonmichael opened this issue 4 years ago • 1 comments

The help command looks up its argument as an Info node, by default. Normally for me the TOPIC argument is quite forgiving, ie

  • you can give it a prefix
  • case doesn't matter
  • if it can't find any match, it shows the top node.

But today instead of having homebrew-installed info 6.8 in PATH, I had macos big sur's default info 4.8 (from 2004). With this, you get ugly errors like:

$ hledger-1.24 help queries    # actual node title is QUERIES
info: Cannot find node `queries'.
hledger-1.24: callCommand: info -f /private/var/folders/r7/f9j9c2zd1k97v47cr84j_qvc0000gp/T/hledger-hledger35585-0.info -n 'queries' (exit 1): failed

This is a bad experience, perhaps we should warn about the info version or something.

simonmichael avatar Dec 03 '21 19:12 simonmichael

If you are on mac, the workaround right now is to install current info with homebrew. You may also need to explicitly add it to your PATH.:

$ brew install texinfo
$ echo 'export PATH=/opt/homebrew/opt/texinfo/bin:$PATH' >> ~/.profile  # or possibly brew link texinfo --force
$ source ~/.profile
$ type -a info
info is /opt/homebrew/opt/texinfo/bin/info
info is /usr/bin/info
$ info --version
info (GNU texinfo) 6.8

Copyright (C) 2021 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

simonmichael avatar Dec 03 '21 19:12 simonmichael