#!/bin/sh
: ; exec klone $0 "$@"
; The above line finds the klone executable in the $PATH
;;Skeleton of a typical klone script
;;(stack-dump-on-error t)
;;(kdb t)

(setq args (getopts "USAGE:linelength files...
print max line length in files...
file must be \"-\" for stdin
"
))

(defun main (&aux
  )
  (setq linelen 0)
  (dolist (file args)
    (setq fd (if (= "-" file) *standard-input* (open file)))
    (if fd
      (catch 'EOF
	(while t
	  (if (> (setq ll (length (read-line fd))) linelen)
	    (setq linelen ll)
      )))
      (setq linelen "*** cannot open ***")
    )
  )
  (print-format "%0\n" linelen)
)

(main)

;;; EMACS MODES
;;; Local Variables: ***
;;; mode:lisp ***
;;; End: ***

