Getting Started
The following steps will guide you through the process of installing and running Claptrap.
-
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 --lockedSee the installation guide for details of how to install Claptrap on your system.
-
Create a script:
hello.sh
:#!/usr/bin/env bashset -euo pipefaileval "$(claptrap --spec - -- "$@" <<'SPEC'name = "hello"[args]name = { short = 'n', long = "name", default-value = "world" }SPEC)"echo "hello, ${claptrap_name}!" -
Make the script executable:
Terminal window chmod +x hello.sh -
Run the script:
Terminal window $ ./hello.sh -n fujihello, fuji!