1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00
serenity/Userland/Applications/Help
Sam Atkins 8461f8c1cd Help: Add support for launching with a section and page, like man
I found it strange that `man` and `Help` did not accept the same command
line arguments since they are so similar. So... now they do. :^)

This means you can now open for example the `tar` man page in Help with
`Help tar`, or `Help 1 tar` if you want to disambiguate between pages in
different sections.

If the result is not found, it falls back to the previous behavior,
treating the input as a search query.

Initially I had this written as two optional positional arguments, but
when told to parse `[optional int] [optional string]`, and then given a
string input, ArgsParser forwards it to the [optional int], which then
fails to parse. Ideally it would pass it to the second, [optional
string] arg instead, but that looks like a fairly big change to make to
ArgsParser's internals, and risk breaking things. Maybe this ugly hack
will be an incentive to fix it. :^)
2021-12-20 10:58:41 -08:00
..
CMakeLists.txt Help: Port to LibMain :^) 2021-11-24 00:25:22 +01:00
History.cpp Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
History.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
main.cpp Help: Add support for launching with a section and page, like man 2021-12-20 10:58:41 -08:00
ManualModel.cpp LibCore+AK: Move MappedFile from AK to LibCore 2021-11-23 11:33:36 +01:00
ManualModel.h LibCore+AK: Move MappedFile from AK to LibCore 2021-11-23 11:33:36 +01:00
ManualNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ManualPageNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ManualPageNode.h Everywhere: Pass AK::StringView by value 2021-11-11 01:27:46 +01:00
ManualSectionNode.cpp Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00
ManualSectionNode.h Everything: Move to SPDX license identifiers in all files. 2021-04-22 11:22:27 +02:00