diff --git a/flake.nix b/flake.nix index d1e98df8..201d670e 100644 --- a/flake.nix +++ b/flake.nix @@ -61,7 +61,7 @@ topiary-inplace = pkgs.writeShellApplication { name = "topiary-inplace"; text = '' - ${code.topiary-cli}/bin/topiary --in-place --input-files "$@"; + ${code.topiary-cli}/bin/topiary fmt "$@"; ''; }; in diff --git a/playground.sh b/playground.sh index a027b98b..40ed72bd 100755 --- a/playground.sh +++ b/playground.sh @@ -40,16 +40,10 @@ format() { local input="$2" local skip_idempotence="${3-1}" - local -a topiary_args=( - --query "${query}" - --input-files "${input}" - ) + local -a topiary_args=(--query "${query}") + (( skip_idempotence )) && topiary_args+=(--skip-idempotence) - if (( skip_idempotence )); then - topiary_args+=(--skip-idempotence) - fi - - cargo run --quiet -- "${topiary_args[@]}" + cargo run --quiet -- fmt "${topiary_args[@]}" < "${input}" } idempotency() {