Skip to content

Add M2-language-server manpage - #4479

Open
d-torrance wants to merge 3 commits into
Macaulay2:developmentfrom
d-torrance:lsp-man
Open

Add M2-language-server manpage#4479
d-torrance wants to merge 3 commits into
Macaulay2:developmentfrom
d-torrance:lsp-man

Conversation

@d-torrance

Copy link
Copy Markdown
Member

We add a manpage for the M2-language-server script, fixing #4446. The manpage itself is generated using help2man from the new --help and --version options that have been added to M2-language-server.

For now, this only installs the manpage using the autotools build (which the Debian package uses, so this will fix the Lintian warning mentioned in #4446). The language server itself isn't installed yet in the cmake build (see #4453), so we hold off on the manpage there.

AI Disclosure

I used Claude Code to write the usage function and the while loop for checking command line options in M2-language-server.

@d-torrance d-torrance linked an issue Jul 19, 2026 that may be closed by this pull request
@d-torrance d-torrance added build issue platform specific issues involving compiling M2, generating examples, or running tests update to existing package(s) labels Jul 19, 2026

@MichaelABurr MichaelABurr left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me. I put a few comments in, but they are more stylistic and can be ignored.

-e 'exit 0'
exit 0
;;
--)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty "--" is treated as a non-command? This seems fine, but this could return an error.

usage >&2
exit 1
;;
*)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any non-options are ignored? This is ok, but also could return an error.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As soon as we encounter a non-option, it breaks the loop. Same with -- above (see https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html Guideline 10)

# and/or the M2-language-server --help output, and then commit
# M2-language-server.1 to git

M2-language-server.1: M2-language-server

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I like to put "default: M2-language-server.1" as the first item in a Makefile, so that multiple targets can be default, if desired. But, this is more a style thing than anything else

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point -- I'll add that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build issue platform specific issues involving compiling M2, generating examples, or running tests update to existing package(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

M2-language-server needs a manual page

2 participants