1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-06-02 15:30:14 -07:00

Use f-strings for command line options

These are more readable than the .format strings.
This commit is contained in:
Frederik Gladhorn 2020-01-13 13:05:24 +01:00
parent 5a20b35171
commit 6461596219

View File

@ -214,19 +214,17 @@ def main():
description='Interact with the LG SmartThinQ API.' description='Interact with the LG SmartThinQ API.'
) )
parser.add_argument('cmd', metavar='CMD', nargs='?', default='ls', parser.add_argument('cmd', metavar='CMD', nargs='?', default='ls',
help='one of {}'.format(', '.join(EXAMPLE_COMMANDS))) help=f'one of: {", ".join(EXAMPLE_COMMANDS)}')
parser.add_argument('args', metavar='ARGS', nargs='*', parser.add_argument('args', metavar='ARGS', nargs='*',
help='subcommand arguments') help='subcommand arguments')
parser.add_argument( parser.add_argument(
'--country', '-c', '--country', '-c',
help='country code for account (default: {})' help=f'country code for account (default: {wideq.DEFAULT_COUNTRY})'
.format(wideq.DEFAULT_COUNTRY)
) )
parser.add_argument( parser.add_argument(
'--language', '-l', '--language', '-l',
help='language code for the API (default: {})' help=f'language code for the API (default: {wideq.DEFAULT_LANGUAGE})'
.format(wideq.DEFAULT_LANGUAGE)
) )
args = parser.parse_args() args = parser.parse_args()