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

Generation of man pages #85

Closed
fujiapple852 opened this issue May 2, 2022 · 8 comments · Fixed by #1089
Closed

Generation of man pages #85

fujiapple852 opened this issue May 2, 2022 · 8 comments · Fixed by #1089
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Milestone

Comments

@fujiapple852
Copy link
Owner

No description provided.

@fujiapple852 fujiapple852 added the documentation Improvements or additions to documentation label May 2, 2022
@fujiapple852 fujiapple852 added the help wanted Extra attention is needed label Nov 3, 2023
@ehaupt
Copy link
Contributor

ehaupt commented Apr 3, 2024

help2man creates a good man page:

help2man -s 1 -Nn "Network diagnostic tool inspired by mtr" `which trip` -o files/trip.1

Here is what it generated.

Maybe this would be a start?

@fujiapple852
Copy link
Owner Author

Hi @ehaupt,

What I had in mind here was using https://github.com/clap-rs/clap/tree/master/clap_mangen since Trippy is already using clap (for command line parsing) and clap_complete (for generating shell completions).

I haven't given this much thought, but I was imaging this may work in a similar way to the completions, where there is a command such as:

trip --generate-man > /path/to/man/pages/trip.1

So the command outputs to stdout and the user can redirect it to a file in wherever their man pages are stored.

Thoughts?

@ehaupt
Copy link
Contributor

ehaupt commented Apr 3, 2024

Clap would also suffice. Regardless, it would be beneficial if the man page were generated during the build process, enabling packagers (I maintain the FreeBSD port) to install it easily.

@ehaupt
Copy link
Contributor

ehaupt commented Apr 4, 2024

FYI: I've just added an option to the FreeBSD port for a html2man generated man page. I'll be more than happy to adjust the mechanism in the future.

freebsd/freebsd-ports@0c470ad

@fujiapple852
Copy link
Owner Author

it would be beneficial if the man page were generated during the build process, enabling packagers (I maintain the FreeBSD port) to install it easily.

That is a valid point @ehaupt. I think this could be created at build time during a release, i'm just not sure where the generated man page file could be stored, I guess the Assets section in the release note ?

Given the help2man runs after the build then I guess it could (in the future if/when it exists) be modified to be something like:

post-build-MANPAGES-on:
	${CARGO_TARGET_DIR}/${CARGO_BUILD_TARGET}/*/trip --generate-man trip.1

@ehaupt
Copy link
Contributor

ehaupt commented Apr 5, 2024

I was searching for a method to install man pages using the cargo toolchain. Upon reading rust-lang/cargo#2729, I discovered that this process is not as straightforward as it is with cmake or autotools.

In this context, your proposed solution of adding a --generate-man flag to enable man page generation at runtime appears to be the optimal approach. This allows me to generate the man pages in the post-build section and install them in the post-install section.

@fujiapple852
Copy link
Owner Author

@ehaupt PR for adding --generate-man: #1089

fujiapple852 added a commit that referenced this issue Apr 5, 2024
fujiapple852 added a commit that referenced this issue Apr 5, 2024
@fujiapple852 fujiapple852 added enhancement New feature or request and removed help wanted Extra attention is needed labels Apr 5, 2024
@fujiapple852 fujiapple852 added this to the 0.11.0 milestone Apr 5, 2024
fujiapple852 added a commit that referenced this issue Apr 5, 2024
fujiapple852 added a commit that referenced this issue Apr 5, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
fujiapple852 added a commit that referenced this issue Apr 10, 2024
@fujiapple852
Copy link
Owner Author

Merged, will be available in 0.11.0

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Aug 12, 2024
[0.11.0] - 2024-08-11

Added

- Added NAT detection for `IPv4/udp/dublin` ([#1104](fujiapple852/trippy#1104))
- Added public API ([#1192](fujiapple852/trippy#1192))
- Added support for NAT detection (`N`) column ([#1219](fujiapple852/trippy#1219))
- Added support for last icmp packet type (`T`) column ([#1105](fujiapple852/trippy#1105))
- Added support for last icmp packet code (`C`) column ([#1109](fujiapple852/trippy#1109))
- Added support for the probe failure count (`f`) column ([#1258](fujiapple852/trippy#1258))
- Added settings dialog tab hotkeys ([#1217](fujiapple852/trippy#1217))
- Added `--dns-ttl` flag to allow refreshing the reverse DNS
  results ([#1233](fujiapple852/trippy#1233))
- Added `--generate-man` flag for generating [ROFF](https://en.wikipedia.org/wiki/Roff_(software)) man
  page ([#85](fujiapple852/trippy#85))
- Added Ubuntu PPA package ([#859](fujiapple852/trippy#859))
- Added Chocolatey package ([#572](fujiapple852/trippy#572))

Changed

- [BREAKING CHANGE] Changed initial sequence to be `33434` ([#1203](fujiapple852/trippy#1203))
- [BREAKING CHANGE] Renamed `tui-max-[samples|flows]`
  as `max-[samples|flows]` ([#1187](fujiapple852/trippy#1187))
- Separated library and binary crates ([#1141](fujiapple852/trippy#1141))
- Record `icmp` packet code ([#734](fujiapple852/trippy#734))
- Transient error handling for `IPv4` on macOS, Linux &
  Windows ([#1255](fujiapple852/trippy#1255))
- Improved error messages ([#1150](fujiapple852/trippy#1150))
- Revamp the help dialog ([#1260](fujiapple852/trippy#1260))

Fixed

- Fixed `DestinationUnreachable` incorrectly assumed to come from target
  host ([#1225](fujiapple852/trippy#1225))
- Fixed incorrect target hop calculation ([#1226](fujiapple852/trippy#1226))
- Do not conflate `AddressInUse` and `AddrNotAvailable`
  errors ([#1246](fujiapple852/trippy#1246))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants