CLI
Structure
The CLI tool uses the kotlinx.cli package for parsing arguments and calling the appropriate
functions or printing usage information if parsing fails. Additionally, functions are included for
unwrapping and handling Innamark's custom error handling classes
(see Concepts for more information on error handling).
Expansion
To Expand upon the CLI tool's current functionality you will have to:
- Create a new
kotlinx.cli.Subcommandclass for argument parsing within theclifunction. - Create a new function for the new actions that can be called by the Subcommand class's
executeoverride function. - For Top-Level commands (like
Add,Text,Remove):- add the new Subcommand class to the
parser.subcommandslist within theclifunction.
- add the new Subcommand class to the
- For Lower-Level commands (like
TextAdd,TextList,TextRemove):- Register the new Subcommand to the parent Subcommand class using the
initblock andthis.subcommands.
- Register the new Subcommand to the parent Subcommand class using the