mirror of
https://github.com/alibaba/arthas.git
synced 2026-11-14 06:45:19 +00:00
update as.sh to support --versions
This commit is contained in:
1 parent
6d8ebeea23
commit
280fac704c
2 files changed
+32
-2
No files matched your search
@@ -204,6 +204,7 @@ Usage:
|
||||
[-f] : specify the path to batch script file.
|
||||
[--attach-only] : only attach the arthas agent to target jvm.
|
||||
[--use-version] : use the specified arthas version to attach.
|
||||
[--versions] : list all arthas versions.
|
||||
|
||||
Example:
|
||||
./as.sh <PID>
|
||||
@@ -213,7 +214,8 @@ Example:
|
||||
./as.sh -b <PID>
|
||||
./as.sh -b -f /path/to/script
|
||||
./as.sh --attach-only <PID>
|
||||
./as.sh --use-version 2.0.20161221142407 <PID>
|
||||
./as.sh --use-version 3.0.5.20180919185025 <PID>
|
||||
./as.sh --versions
|
||||
|
||||
Here is the list of possible java process(es) to attatch:
|
||||
|
||||
@@ -221,6 +223,13 @@ $(${JAVA_HOME}/bin/jps -l | grep -v sun.tools.jps.Jps)
|
||||
"
|
||||
}
|
||||
|
||||
# list arthas versions
|
||||
list_versions()
|
||||
{
|
||||
echo "Arthas versions under ${ARTHAS_LIB_DIR}:"
|
||||
ls -1 ${ARTHAS_LIB_DIR}
|
||||
}
|
||||
|
||||
# parse the argument
|
||||
parse_arguments()
|
||||
{
|
||||
@@ -229,6 +238,11 @@ parse_arguments()
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if ([ "$1" = "--versions" ]) ; then
|
||||
list_versions
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "$1" = "-b" ]; then
|
||||
BATCH_MODE=true
|
||||
shift
|
||||
|
||||
Reference in new issue
Block a user