Commit a24c5a40 by Dwight Engen Committed by Daniel Lezcano

Fix lxc-netstat -- argument processing

Commit 21e487f2 introduced the use of getopt, but getopt will fail when it sees arguments meant for netstat that are not in [short|long]options. There should not be any ambiguity about arguments with the same letter: those to the left of the -- are destined for lxc-netstat and those to the right for the real netstat, which the original code handles by shifting out all arguments it recognizes before the -- is hit. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent a3812bf0
...@@ -67,19 +67,8 @@ get_parent_cgroup() ...@@ -67,19 +67,8 @@ get_parent_cgroup()
done done
} }
shortoptions='hn:'
longoptions='help,name:,exec'
getopt=$(getopt -o $shortoptions --longoptions $longoptions -- "$@")
if [ $? != 0 ]; then
usage
exit 1;
fi
exec="" exec=""
eval set -- "$getopt"
while true; do while true; do
case $1 in case $1 in
-h|--help) -h|--help)
...@@ -91,7 +80,7 @@ while true; do ...@@ -91,7 +80,7 @@ while true; do
--) --)
shift; break;; shift; break;;
*) *)
break; break;;
esac esac
done done
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment