blob: b91023cd94d7b32c64b77b6098320490b05f69ef [file] [log] [blame]
David K. Bainbridge317e7d72016-05-11 08:31:44 -07001#!/bin/bash
2
3PROG=$(basename $0)
4
5usage() {
6 echo "$PROG: [options]"
7 echo ""
8 echo " -h | --help display this message"
9}
10
11FILE=
12while [ $# -gt 0 ]; do
13 case $1 in
14 -h|--help)
15 usage
16 exit
17 ;;
18 *)
19 FILE=$1
20 ;;
21 esac
22 shift
23done
24
25if [ "$FILE x" == " x" ]; then
26 sed -e 's|//.*$||g' -e '/^\s*$/d' # <&0
27else
28 cat $FILE | sed -e 's|//.*$||g' -e '/^\s*$/d'
29fi