1
0
Fork
You've already forked sigil-args
0
Command-line argument parsing for Sigil.
  • Scheme 100%
Find a file
David Wilson e8f9427990
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Bump sigil-args to 0.16.0
2026年05月06日 15:39:04 +03:00
docs docs: Add package documentation for sigil-args, sigil-test, and sigil-sqlite 2026年02月19日 16:12:41 +02:00
src/sigil Add procedure specs to args, ansi, process, and hooks modules 2026年02月25日 07:07:31 +02:00
test sigil-args: Add new features and comprehensive documentation 2026年01月12日 14:19:52 +02:00
.gitignore Extract sigil-args from sigil monorepo as standalone repo 2026年04月26日 00:41:08 +03:00
.woodpecker.yml Bump CI pin to sigil v0.14.3 2026年04月26日 20:17:39 +03:00
dev-redirects.sgl Extract sigil-args from sigil monorepo as standalone repo 2026年04月26日 00:41:08 +03:00
manifest.scm Extract sigil-args from sigil monorepo as standalone repo 2026年04月26日 00:41:08 +03:00
package.sgl Bump sigil-args to 0.16.0 2026年05月06日 15:39:04 +03:00
README.md Extract sigil-args from sigil monorepo as standalone repo 2026年04月26日 00:41:08 +03:00
sigil.lock Bump package metadata for Sigil 0.15 2026年05月03日 10:22:29 +03:00

sigil-args

Declarative command-line argument parsing for Sigil.

Defines CLIs as composable record values: options, commands, subcommands, with automatic help generation.

Usage

(import (sigil args))
(define cli
 (command
 name: "greet"
 description: "Print a greeting"
 options: (list
 (option name: 'name short: #\n long: "name"
 value: "NAME" default: "World")
 (option name: 'loud short: #\l long: "loud"
 description: "Use uppercase"))
 handler: (lambda (opts args)
 (let ((greeting (format "Hello, ~a!" (alist-get 'name opts))))
 (display (if (alist-get 'loud opts)
 (string-upcase greeting)
 greeting))
 (newline)))))
(run-command cli (cdr (command-line)))

Supports short flags (-v, -vvv, -vf), long flags (--verbose, --no-verbose), values (-o val, --output=val), -- to stop option parsing, env-var fallback, choice restriction, multi-value (repeatable) options, negatable booleans, custom parsers, and required flags.

See docs/args.md for the full reference.

Building

sigil deps install
sigil build
sigil test

For local development against an in-tree sigil-lang checkout:

sigil build --redirects ./dev-redirects.sgl

License

BSD-3-Clause. See LICENSE (license header lives in package.sgl).