hack *args:
    cargo hack {{ args }} \
        --feature-powerset \
        --mutually-exclusive-features native-tls,rustls \
        --at-least-one-of native-tls,rustls

pre-commit:
    codespell
    just hack check --quiet
    cargo clippy
    cargo fmt --check

[arg("data", short="d")]
[arg("config", short="c")]
preview data="data/test/aoc-response.json" \
    config="data/test/srv-config.toml" \
    port="8080":
    AOC_TEST_DATA="$(cat '{{ data }}')" \
        cargo run -- serve -c '{{ config }}' -l '[::]:{{ port }}'

release:
    RUSTFLAGS="\
        -Z fmt-debug=none \
        -C link-arg=-fuse-ld=lld \
        -C force-unwind-tables=no \
    " \
        cargo build --release
