#!/usr/bin/env ion

# set path to include sniff
let PATH=$HOME/.cargo/bin:$PATH

# 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

#do the actual benchmarks

echo 'gnu coreutils vs. sniff: show all files over 1M...'
bench "(du -hc -d2 $path | rg M)"
bench "(du -hc -d2 $path | grep M)"
bench "sniff fat $path"

echo 'gnu coreutils vs. sniff: show the 20 biggest files/directories...'
bench "du -c -d2 $path | sort -nr | head -n20"
bench "sniff sort $path"
