Skip to content

Examples

This section provides various examples demonstrating the features and usage of aperturerobotics/cli.

  • Arguments: Learn how to access command-line arguments.
  • Bash Completions: Enable and customize bash completion for your application.
  • Combining Short Options: Allow users to combine short boolean flags (e.g., -abc).
  • Exit Codes: Control the exit code of your application based on success or failure.
  • Flags: Define and use various types of flags (string, bool, int, slice, etc.).
  • Full API Example: A comprehensive example showcasing many API features.
  • Generated Help Text: Understand and customize the automatically generated help messages.
  • Greet Example: A simple introductory "hello world" style application.
  • Subcommand Categories: Organize subcommands into categories in the help output.
  • Subcommands: Structure your application using commands and subcommands.
  • Suggestions: Enable suggestions for mistyped commands or flags.
  • Timestamp Flag: Use flags to accept date/time input.
  • Version Flag: Customize the built-in version flag behavior.