Skip to content
🚧 🚧 🚧 Under construction 🚧 🚧 🚧

Getting Started

The following steps will guide you through the process of installing and running Claptrap.

  1. Install Claptrap:

    Claptrap runs on Linux, BSD, macOS, and Windows. It can be installed from most common package managers, precompiled binaries, or source.

    Terminal window
    cargo install claptrap --locked

    See the installation guide for details of how to install Claptrap on your system.

  2. Create a script:

    hello.sh:

    #!/usr/bin/env bash
    set -euo pipefail
    eval "$(claptrap --spec - -- "$@" <<'SPEC'
    name = "hello"
    [args]
    name = { short = 'n', long = "name", default-value = "world" }
    SPEC
    )"
    echo "hello, ${claptrap_name}!"
  3. Make the script executable:

    Terminal window
    chmod +x hello.sh
  4. Run the script:

    Terminal window
    $ ./hello.sh -n fuji
    hello, fuji!