Skip to content

Commit 667418e

Browse files
committed
Print the init command to stderr.
1 parent cde7d3a commit 667418e

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

mycli/main.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import stat
1111
from collections import namedtuple
1212

13+
from pygments.lexer import combined
14+
1315
try:
1416
from pwd import getpwuid
1517
except ImportError:
@@ -1353,6 +1355,9 @@ def cli(
13531355
password_file=password_file,
13541356
)
13551357

1358+
if combined_init_cmd:
1359+
click.echo("Executing init-command: %s" % combined_init_cmd, err=True)
1360+
13561361
mycli.logger.debug("Launch Params: \n" "\tdatabase: %r" "\tuser: %r" "\thost: %r" "\tport: %r", database, user, host, port)
13571362

13581363
# --execute argument

mycli/sqlexecute.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,12 +233,9 @@ def connect(
233233
ssl=ssl_context,
234234
program_name="mycli",
235235
defer_connect=defer_connect,
236-
init_command=init_cmd or None,
236+
init_command=init_command or None,
237237
)
238238

239-
if init_command:
240-
print("Running init commands:\n", init_command)
241-
242239
if ssh_host:
243240
##### paramiko.Channel is a bad socket implementation overall if you want SSL through an SSH tunnel
244241
#####

0 commit comments

Comments
 (0)