CLI::Help

add -h / --help parameters to your script

NAME

CLI::Help - add -h / --help parameters to your script

SYNOPSIS

proto sub MAIN(|) {*}
use CLI::Help %?RESOURCES, &MAIN;

sub handler($text, @subsections, :$verbose) {
    say "Help for foo @subsections";
    say $text;
    say "Verbose version" if $verbose;
}
use CLI::Help %?RESOURCES, &MAIN, &handler;

DESCRIPTION

CLI::Help adds a multi sub candidate to the &MAIN function in your script, that will trigger if the script is called with -h or --help named arguments only, and any positional arguments.

For instance, in the App::Rak distribution, which provides a rak CLI, calling rak --help will result in something like:

$ rak --help
rak - a CLI for searching strings in files and more
---------------------------------------------------
...

And calling rak --help --verbose

$ rak --help --verbose
rak - a CLI for searching strings in files and more
---------------------------------------------------
...

Provided by App::Rak - 0.0.14 by Elizabeth Mattijsen,
  implemented in the RakuĀ® Programming Language 6.d,
  running on Rakudoā„¢ 2022.06.55, built on Moar 2022.06.2.

Suggestions / bug reports / general comments are welcome at
  https://github.com/lizmat/App-Rak

Thank you for using rak!

AUTHOR

Elizabeth Mattijsen [email protected]

Source can be located at: https://github.com/lizmat/CLI-Help . Comments and Pull Requests are welcome.

If you like this module, or what Iā€™m doing more generally, committing to a small sponsorship would mean a great deal to me!

COPYRIGHT AND LICENSE

Copyright 2022 Elizabeth Mattijsen

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

CLI::Help v0.0.1

add -h / --help parameters to your script

Authors

  • Elizabeth Mattijsen

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • CLI::Help

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.