Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix help command on macOS Ventura to use mandoc -a #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

crowedavid
Copy link

If interested, I updated encpass_help_prog() to work on macOS Ventura (probably earlier too) with the following:

  • "man -l" error output uses "illegal" instead of "invalid"
  • to use "mandoc -a" instead of the tbl+groff+less pipeline since macOS doesn't include tbl+groff

@ahnick
Copy link
Collaborator

ahnick commented Jan 22, 2023

Hey David,
Thanks for submitting the PR! Had I realized mandoc existed I would have used that earlier. :-)

I tested on my local with mandoc and it worked; however, I'm on Monterey (version 12.1) and it still says "invalid" in the error message if you try to use man with the -l option. See the output below.

$ man -l
man: invalid option -- l
man, version 1.6g

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

  a : find all matching entries
  c : do not use cat file
  d : print gobs of debugging information
  D : as for -d, but also display the pages
  f : same as whatis(1)
  h : print this help message
  k : same as apropos(1)
  K : search for a string in all pages
  t : use troff to format pages for printing
  w : print location of man page(s) that would be displayed
      (if no name given: print directories that would be searched)
  W : as for -w, but display filenames only

  C file   : use `file' as configuration file
  M path   : set search path for manual pages to `path'
  P pager  : use program `pager' to display pages
  S list   : colon separated section list
  m system : search for alternate system's man pages
  p string : string tells which preprocessors to run
               e - [n]eqn(1)   p - pic(1)    t - tbl(1)
               g - grap(1)     r - refer(1)  v - vgrind(1)
$ sw_vers
ProductName:	macOS
ProductVersion:	12.1
BuildVersion:	21C52

What is the exact output you see when you run "man -l" on your local? Is it the same as mine except the message now has "illegal" where mine says "invalid" now?

If so, then I can probably just add an OR condition to make it work for older versions of macOS as well.

Thanks!

@crowedavid
Copy link
Author

similar output but more truncated on Ventura:

$ man -l
/usr/bin/man: illegal option -- l
Usage:
 man [-adho] [-t | -w] [-M manpath] [-P pager] [-S mansect]
     [-m arch[:machine]] [-p [eprtv]] [mansect] page [...]
 man -f page [...] -- Emulates whatis(1)
 man -k page [...] -- Emulates apropos(1)
$ sw_vers
ProductName:		macOS
ProductVersion:		13.1
BuildVersion:		22C65

your OR condition should work well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants