View Source CliAppHelper (cli_app_helper v0.1.2)

Helps with the creation of basic CLI applications for Polymorfiq LLC

Link to this section Summary

Functions

Runs the given CLI Application, utilizing the entrypoint's metadata.

Runs the given command with the given args, utilizing the command's metadata to parse options.

Link to this section Types

@type command() :: module()
@type entrypoint() :: module()

Link to this section Functions

@spec run(entrypoint(), [String.t()]) :: nil

Runs the given CLI Application, utilizing the entrypoint's metadata.

Uses CliAppHelper.Entrypoint.helper_text/0 to get the application's help text. Uses CliAppHelper.Entrypoint.commands/0 to get the application's available commands.

Link to this function

run_command(command, args)

View Source
@spec run_command(command(), [String.t()]) :: :ok | {:error, String.t()}

Runs the given command with the given args, utilizing the command's metadata to parse options.

Uses CliAppHelper.Command.helper_text/0 to get the command's help text. Uses CliAppHelper.Command.flags/0 to get the command's available command-line flags. Uses CliAppHelper.Command.run/2 to run the command with the parsed args and flags.