improve '\f' format string handling for --print
add a newline only for f-string / \fF format strings, as it would break any of the others
This commit is contained in:
@@ -181,11 +181,13 @@ class PrintAction(argparse.Action):
|
||||
|
||||
if format_string.startswith("\\f"):
|
||||
format_string = "\f" + format_string[2:]
|
||||
elif "{" not in format_string and \
|
||||
" " not in format_string and \
|
||||
format_string[0] != "\f":
|
||||
format_string = "{" + format_string + "}"
|
||||
if format_string[-1] != "\n":
|
||||
|
||||
if format_string[0] == "\f":
|
||||
if format_string[1] == "F" and format_string[-1] != "\n":
|
||||
format_string += "\n"
|
||||
elif "{" not in format_string and " " not in format_string:
|
||||
format_string = "{" + format_string + "}\n"
|
||||
elif format_string[-1] != "\n":
|
||||
format_string += "\n"
|
||||
|
||||
namespace.postprocessors.append({
|
||||
|
||||
Reference in New Issue
Block a user