Alaja.CLI.Validator (Alaja v1.0.0)

Copy Markdown View Source

Validacion de inputs para comandos CLI.

Uso

Alaja.CLI.Validator.validate_flags(flags, parsed)
Alaja.CLI.Validator.validate_args(arguments, positional)

Summary

Functions

Checks if a command is potentially dangerous.

Validates positional arguments against command definition.

Validates parsed flags against command definition.

Functions

dangerous?(command)

@spec dangerous?(String.t()) :: boolean()

Checks if a command is potentially dangerous.

validate_args(arguments, positional)

@spec validate_args([map()], [String.t()]) :: :ok | {:error, [String.t()]}

Validates positional arguments against command definition.

validate_flags(flags, parsed)

@spec validate_flags(
  [map()],
  keyword()
) :: :ok | {:error, [String.t()]}

Validates parsed flags against command definition.