Skip to content

Commit 58eaa5d

Browse files
committed
cleanup
1 parent 4688123 commit 58eaa5d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libexec/profile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
event=cpu
44
format=flat
55
seconds=12
6-
usage="Usage: profile [-h] [-s seconds] [-w seconds] [-e event] [-f format] [--] executable args"
6+
usage1="Usage: profile [-h] [-s seconds] [-w seconds] [-e event] [-f format] [--] executable args"
77
usage2="Usage: profile [options] executable args\nOptions:\n\t[-h] [-s seconds] [-w seconds]\n\t[-e cpu|alloc|nativemem|lock|cache-misses]\n\t[-f flat|traces|collapsed|flamegraph|tree|jfr|otlp]"
88

99
while getopts s:f:e:o:w:h opt
@@ -16,8 +16,8 @@ do
1616
w) warmup=$OPTARG ;;
1717
h) echo -e $usage2 && exit 0 ;;
1818
--) break ;;
19-
\?) echo $usage && exit 1 ;;
20-
# :) echo $usage && exit 2 ;;
19+
\?) echo $usage1 && exit 1 ;;
20+
# :) echo $usage1 && exit 2 ;;
2121
esac
2222
done
2323

@@ -26,10 +26,10 @@ executable=$1
2626
arguments=${@:2}
2727

2828
which asprof >& /dev/null
29-
[ "$?" -ne 0 ] && echo 'ERROR: asprof is not in $PATH.' && exit 3
29+
[ "$?" -ne 0 ] && echo 'ERROR: asprof is not in $PATH.' && echo -e $usage2 && exit 3
3030

3131
which $executable >& /dev/null
32-
[ "$?" -ne 0 ] && echo "ERROR: $executable is not in \$PATH." && exit 4
32+
[ "$?" -ne 0 ] && echo "ERROR: $executable is not in \$PATH." && echo -e $usage2 && exit 4
3333

3434
echo "Running asprof on '$executable $arguments' ..."
3535

0 commit comments

Comments
 (0)