From 607894648c7be81183236e3d740f9a5331db2dbe Mon Sep 17 00:00:00 2001 From: Nicholas Hope Date: Wed, 5 Oct 2022 21:31:58 -0400 Subject: [PATCH] Added unused warning options --- src/tfscript/cli.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/tfscript/cli.py b/src/tfscript/cli.py index 1c4f0ba..368eb6a 100644 --- a/src/tfscript/cli.py +++ b/src/tfscript/cli.py @@ -91,6 +91,16 @@ def parseCLI(): help='Force tfscript to continue until catastrophic failure') parser.add_argument( '-D', '--directory', action='store', type=str, help='Change output directory') + # warnings + parseWarnNames = [ + 'implicit-release', 'implicit-off', + 'implicit-primary', 'implicit-secondary', + 'implicit' + ] + for warnName in parseWarnNames: + splitWarnName = ' '.join(warnName.split('-')) + parser.add_argument( '-W' + warnName, action='store_true', + help=f'Generate warning on {splitWarnName} creation') # positional argument: first non-hyphenated argument is input file parser.add_argument( 'infile', type=argparse.FileType('r'), help='File containing YAML to convert.') @@ -100,11 +110,12 @@ def getTargetDir(systemName): if systemName == 'Darwin': if float( '.'.join( GetOSRelease().split('.')[0:2] ) ) >= 10.15: warn( - 'As of macOS Catalina (v10.15), 32-bit applications ' - 'like TF2 do not run. tfscript will run, but you can\'t run TF2 ' - 'on this system', + 'As of macOS Catalina (v10.15), 32-bit applications' + + ' like TF2 do not run. tfscript will run, but you can\'t run TF2' + + ' on this system', category=RuntimeWarning ) - return expanduser('~/Library/Application Support/Steam') + return None + return expanduser('~/Library/Application Support/Steam') elif systemName == 'Windows': # oh god why do we have to use the registry