Add support for --output-file-append. Fixes #15074.

This commit is contained in:
Pedro Algarvio 2014-08-19 21:40:24 +01:00
parent 75c8e1839e
commit 1e2460e504

View File

@ -987,6 +987,13 @@ class OutputOptionsMixIn(object):
default=None,
help='Write the output to the specified file'
)
group.add_option(
'--out-file-append', '--output-file-append',
action='store_true',
dest='output_file_append',
default=False,
help='Append the output to the specified file'
)
group.add_option(
'--no-color', '--no-colour',
default=False,
@ -1015,7 +1022,7 @@ class OutputOptionsMixIn(object):
self.selected_output_option = self.options.output
def process_output_file(self):
if self.options.output_file is not None:
if self.options.output_file is not None and self.options.output_file_append is False:
if os.path.isfile(self.options.output_file):
try:
os.remove(self.options.output_file)