X-Git-Url: https://git.phdru.name/?a=blobdiff_plain;f=scripts%2Fmysql2sql;h=e63c1fd8f5942f0735256d5aae12e51e3ebd318a;hb=1f2da2369fe3a90d73ac0355aa2314e920d9d76c;hp=e4f2e4bbf9fa0eb9c84c1759fcd41cc79b13cfb0;hpb=de3d7d28c48e20deb385c7b7a21b404cd42ce31d;p=sqlconvert.git diff --git a/scripts/mysql2sql b/scripts/mysql2sql index e4f2e4b..e63c1fd 100755 --- a/scripts/mysql2sql +++ b/scripts/mysql2sql @@ -31,8 +31,12 @@ def main(infile, encoding, outfile, output_encoding, use_pbar, quoting_style): if size is None: use_pbar = False - print("Converting: ", end='', file=sys.stderr) - sys.stderr.flush() + if use_pbar: + print("Converting", end='', file=sys.stderr) + if infile.name != '': + print(' ' + infile.name, end='', file=sys.stderr) + print(": ", end='', file=sys.stderr) + sys.stderr.flush() if use_pbar: pbar = ttyProgressBar(0, size-1) @@ -66,7 +70,7 @@ def main(infile, encoding, outfile, output_encoding, use_pbar, quoting_style): if use_pbar: pbar.erase() - print("done.") + print("done.") if __name__ == '__main__': parser = argparse.ArgumentParser(description='Convert MySQL to SQL') @@ -133,6 +137,7 @@ if __name__ == '__main__': if outfile == '-': outfile = sys.stdout + args.no_pbar = True else: try: outfile = open(outfile, 'wt', encoding=output_encoding)