#!/bin/csh -f

#H# This program provides disk usage information for a mountpoint (or other dir)
#H# without recursing into other mountpoints.
#H# 
#H# Usage:
#H# duh [path]
#H# 
#H# Note: if the path is omitted the current directory is used.
#H# Note: The script actually runs:
#H# du --one-file-system --human-readable --max-depth=1 [path] | sort --human-numeric-sort
#H# Note: This script requires GNU Coreutils 7.5 or newer.
#H# 
#H# Comment: The script is named "duh" because: DUH! Why didn't the GNU people think of this!

# print usage info if needed
if ("$1" == "-h" || "$1" == "--help" || "$1" == "help") exec sed -n -e '/^\#H\#/s/^....//p' $0

# do the current directory if nothing is specified
if ("$1" == "") then
  set Dir="."
else
  set Dir="$argv"
endif

# do the du and make it cool.
du --one-file-system --human-readable --max-depth=1 "$Dir" | sort --human-numeric-sort