diff mbox series

[nfs-utils] nfsiostat: skip argv[0] when parsing command-line

Message ID 20250121190315.1498852-1-sorenson@redhat.com (mailing list archive)
State Handled Elsewhere
Headers show
Series [nfs-utils] nfsiostat: skip argv[0] when parsing command-line | expand

Commit Message

Frank Sorenson Jan. 21, 2025, 7:03 p.m. UTC
Just skip argv[0] entirely while looping through the command-line
arguments.

Signed-off-by: Frank Sorenson <sorenson@redhat.com>
---
 tools/nfs-iostat/nfs-iostat.py | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

Comments

Steve Dickson Jan. 25, 2025, 4:33 p.m. UTC | #1
On 1/21/25 2:03 PM, Frank Sorenson wrote:
> Just skip argv[0] entirely while looping through the command-line
> arguments.
> 
> Signed-off-by: Frank Sorenson <sorenson@redhat.com>
Committed... (tag: nfs-utils-2-8-3-rc4)

steved.

> ---
>   tools/nfs-iostat/nfs-iostat.py | 6 +-----
>   1 file changed, 1 insertion(+), 5 deletions(-)
> 
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index 85294fb9..31587370 100755
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -592,11 +592,7 @@ client are listed.
>       parser.add_option_group(displaygroup)
>   
>       (options, args) = parser.parse_args(sys.argv)
> -    for arg in args:
> -
> -        if arg == sys.argv[0]:
> -            continue
> -
> +    for arg in args[1:]:
>           if arg in mountstats:
>               origdevices += [arg]
>           elif not interval_seen:
diff mbox series

Patch

diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index 85294fb9..31587370 100755
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -592,11 +592,7 @@  client are listed.
     parser.add_option_group(displaygroup)
 
     (options, args) = parser.parse_args(sys.argv)
-    for arg in args:
-
-        if arg == sys.argv[0]:
-            continue
-
+    for arg in args[1:]:
         if arg in mountstats:
             origdevices += [arg]
         elif not interval_seen: