Skip to content

Commit 6da8be6

Browse files
committed
Fix --json argument handling
1 parent 1170abf commit 6da8be6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

gpustat.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ def new_query():
401401
return GPUStatCollection.new_query()
402402

403403

404-
def print_gpustat(**args):
404+
def print_gpustat(json=False, **args):
405405
'''
406406
Display the GPU query results into standard output.
407407
'''
@@ -430,7 +430,7 @@ def main():
430430
help='Display PID of running process')
431431
parser.add_argument('--gpuname-width', type=int, default=16,
432432
help='The minimum column width of GPU names, defaults to 16')
433-
parser.add_argument('--json', action='store_true',
433+
parser.add_argument('--json', action='store_true', default=False,
434434
help='Print all the information in JSON format')
435435
parser.add_argument('-v', '--version', action='version',
436436
version=('gpustat %s' % __version__))

0 commit comments

Comments
 (0)