File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -63,8 +63,15 @@ def main():
63
63
sys .exit (1 )
64
64
else :
65
65
percent = c .argv [1 ]
66
+ # test the percent integer argument
66
67
try :
67
- int (percent ) # test that the argument can be cast to an integer value
68
+ percent_int = int (percent ) # test that the argument can be cast to an integer value
69
+ if percent_int <= 0 :
70
+ stderr ("[font-line] ERROR: Please enter a percent value that is greater than zero." )
71
+ sys .exit (1 )
72
+ if percent_int > 100 :
73
+ stdout ("[font-line] Warning: You entered a percent value over 100%. Please confirm that this is "
74
+ "your intended metrics modification." )
68
75
except ValueError :
69
76
stderr ("[font-line] ERROR: You entered '" + percent + "'. This argument needs to be an integer value." )
70
77
sys .exit (1 )
@@ -73,8 +80,7 @@ def main():
73
80
if is_supported_filetype (fontpath ):
74
81
if modify_linegap_percent (fontpath , percent ) is True :
75
82
outpath = get_linegap_percent_filepath (fontpath , percent )
76
- stdout ("[font-line] '" + fontpath + "' successfully modified and is available at '" +
77
- outpath + "'." )
83
+ stdout ("[font-line] '" + fontpath + "' successfully modified to '" + outpath + "'." )
78
84
else :
79
85
stderr ("[font-line] ERROR: Unsuccessful modification of '" + fontpath + "'." )
80
86
else :
You can’t perform that action at this time.
0 commit comments