#!/usr/bin/env ion
cargo run -- sort -t1M
cargo run -- fat
cargo run -- sort src/ # to make sure non-ascii displays correctly
cargo build --release

let binpath = target/release/sniff

# set to a suitable path
let path_arg = "false"
for x in @args
    if test $x = "--path"
        let path_arg = "true"
    end
end
if test $path_arg = "true"
    let path = @args[2]
else
    let path = /home/vanessa/programming/haskell/forks/cabal
end

# turn off color
export CLICOLOR=0

#do the actual benchmarks
echo 'gnu coreutils vs. sniff: show all files over 1M...'
bench "sniff fat $path"
bench "$binpath fat $path"

echo 'gnu coreutils vs. sniff: show the 20 biggest files/directories...'
bench "sniff sort $path"
bench "$binpath sort $path"

echo 'sniff for build artifacts & compare to self'
bench "$HOME/.cargo/bin/sniff artifacts --sort /home/vanessa/programming/haskell/forks/cabal"
bench "$binpath artifacts --sort $path"
