#!/usr/bin/env ion

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

#export CLICOLOR=0
let CLICOLOR=0

# set to a suitable path & decide whether to produce reports
let reports = "false"
for x in @args
    if test $x = "+reports"
        let reports = "true"
    end
end

let path = $HOME/programming

# set the benches
let benches = ["sniff all $path" "du -hcd2 $path" "sniff all -pd2 $path" "sniff all -d1 $path" "sniff all -pd1 $path" "du -hcd1 $path" "sniff all -pfd1 $path" "du -hacd1 $path"]

# initialize cache
echo 'initializing file system cache...'
sniff all ~/programming > /dev/null

#do the actual benchmarks
if test $reports = "true"
    echo 'generating reports with benchmarks...'
    mkdir -p reports/
    bench --output reports/fast.html @benches
else
    bench @benches
end
