CLI::Version

add -V / --version parameters to your script

NAME

CLI::Version - add -V / --version parameters to your script

SYNOPSIS

proto sub MAIN(|) {*}
use CLI::Version $?DISTRIBUTION, &MAIN;

# alternately:
use CLI::Version $?DISTRIBUTION, proto sub MAIN(|) {*}

DESCRIPTION

CLI::Version adds a multi sub candidate to the &MAIN function in your script, that will trigger if the script is called with -V or --version arguments only.

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

    $ rak -V
    rak - based on App::Rak 0.0.2, running Raku 6.d on Rakudo 2022.06

If the candidate is triggered, it will exit with the default value for exit (which is usually 0).

IMPLEMENTATION NOTES

Due to the fact that the $?DISTRIBUTION and &MAIN of the code that uses this module, can not be obtained by a public API, it is necessary to provide them in the use statement. This need may disappear in future versions of the Raku Programming Language.

AUTHOR

Elizabeth Mattijsen [email protected]

Source can be located at: https://github.com/lizmat/CLI-Version . 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::Version v0.0.1

add -V / --version parameters to your script

Authors

  • Elizabeth Mattijsen

License

Artistic-2.0

Dependencies

Test Dependencies

Provides

  • CLI::Version

Documentation

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