#!/bin/sh

if [ -z "$1" ]; then
    ls ~/q
elif [ -f ~/q/$1 ]; then
    more ~/q/$1
else
    $1 --help >>~/q/$1 2>>~/q/$1
    if [ -f ~/q/$1 ]; then
	more ~/q/$1
    else
	echo "No help for $1"
    fi
fi