Extend/truncate intervals in BED files based on the given arguments, but keep them between the chromosome boundaries.