Fixed spacing in amd-smi tool output
Signed-off-by: Maisam Arif <maisarif@amd.com>
Change-Id: I83cb040b81a4d3653417ba7399160eb81e95ce33
[ROCm/amdsmi commit: c7726bde3d]
Cette révision appartient à :
@@ -33,6 +33,19 @@ from amdsmi_helpers import AMDSMIHelpers
|
|||||||
import amdsmi_cli_exceptions
|
import amdsmi_cli_exceptions
|
||||||
|
|
||||||
|
|
||||||
|
# Custom Help Formatter for increasing the action max length
|
||||||
|
class SubparserHelpFormatter(argparse.HelpFormatter):
|
||||||
|
def __init__(self, prog,
|
||||||
|
indent_increment=2,
|
||||||
|
max_help_position=24,
|
||||||
|
width=90):
|
||||||
|
super().__init__(prog,
|
||||||
|
indent_increment=indent_increment,
|
||||||
|
max_help_position=max_help_position,
|
||||||
|
width=width)
|
||||||
|
self._action_max_length = 20
|
||||||
|
|
||||||
|
|
||||||
class AMDSMIParser(argparse.ArgumentParser):
|
class AMDSMIParser(argparse.ArgumentParser):
|
||||||
"""Unified Parser for AMDSMI CLI.
|
"""Unified Parser for AMDSMI CLI.
|
||||||
This parser doesn't access amdsmi's lib directly,but via AMDSMIHelpers,
|
This parser doesn't access amdsmi's lib directly,but via AMDSMIHelpers,
|
||||||
@@ -56,9 +69,7 @@ class AMDSMIParser(argparse.ArgumentParser):
|
|||||||
|
|
||||||
# Adjust argument parser options
|
# Adjust argument parser options
|
||||||
super().__init__(
|
super().__init__(
|
||||||
formatter_class=lambda prog: argparse.RawTextHelpFormatter(prog,
|
formatter_class= lambda prog: SubparserHelpFormatter(prog),
|
||||||
max_help_position=80,
|
|
||||||
width=90),
|
|
||||||
description=f"AMD System Management Interface | {version_string} | {platform_string}",
|
description=f"AMD System Management Interface | {version_string} | {platform_string}",
|
||||||
add_help=True,
|
add_help=True,
|
||||||
prog=program_name)
|
prog=program_name)
|
||||||
|
|||||||
Référencer dans un nouveau ticket
Bloquer un utilisateur