#! /bin/sh # from linux/Documentation/kernel-doc-nano-HOWTO.txt # uses linux/scripts/kernel-doc or a copy of it (in $PATH). file="$1" fn="$2" # fmt can be "text" or "man" (default is "text") fmt="$3" if [ x$3 == x ]; then fmt="text" fi if [ x$2 == x ]; then echo "usage: kdoc_function filename funcname [text|man]" exit 1 fi if [ $fmt == "man" ]; then kernel-doc -man -function $fn $file | nroff -man | less else kernel-doc -text -function $fn $file fi