]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc-ps: support '-n name' and '-- ps-options'
authorSerge E. Hallyn <serge.hallyn@canonical.com>
Tue, 9 Aug 2011 14:51:01 +0000 (16:51 +0200)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Tue, 9 Aug 2011 14:51:01 +0000 (16:51 +0200)
This is more consistent with other lxc commands

Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/lxc/+bug/820720

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/lxc-ps.in

index 7b3c8ab36fbcecd5d7200384a611363d54889eb0..dd3b7fe397b9db5d0ae2cdb4ee488f7639d658c4 100755 (executable)
@@ -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;