Commit 3729572b by Serge E. Hallyn Committed by Daniel Lezcano

lxc-ps: support '-n name' and '-- ps-options'

This is more consistent with other lxc commands Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/820720Signed-off-by: 's avatarDaniel Lezcano <dlezcano@fr.ibm.com>
parent dff21ef0
......@@ -134,7 +134,7 @@ sub display_headers {
sub display_usage {
print <<EOF;
Usage: lxc-ps [--help] [--usage] [--name NAME...] [--lxc] [ps options]
Usage: lxc-ps [--help] [--usage] [-n|--name NAME...] [--lxc] [-- ps options]
EOF
}
......@@ -157,7 +157,7 @@ or try a 'ps --help' for further details.
EOF
}
use Getopt::Long qw(:config no_auto_abbrev pass_through);
use Getopt::Long qw(:config pass_through);
my $arg_help = '';
my $arg_usage = '';
......@@ -175,6 +175,10 @@ GetOptions('help' => \$arg_help,
if ($arg_help) {display_help; exit 0;}
if ($arg_usage) {display_usage; exit 0;}
if ($ARGV[0] == '--') {
shift @ARGV;
}
# Should we filter processes related to containers
if ($arg_lxc) {
$LXC_DISPLAY = 1;
......
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