这是indexloc提供的服务,不要输入任何密码
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Upcoming
Bug Fixes:
----------
* Don't install tests.
* let the `--prompt` option act normally with its predefined default value

1.27.0 (2023/08/11)
===================
Expand Down
1 change: 1 addition & 0 deletions mycli/AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Contributors:
* Mel Dafert
* Alfred Wingate
* Zhanze Wang
* Houston Wong

Created by:
-----------
Expand Down
5 changes: 3 additions & 2 deletions mycli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
class MyCli(object):

default_prompt = '\\t \\u@\\h:\\d> '
default_prompt_splitln = '\\u@\\h\\n(\\t):\\d>'
max_len_prompt = 45
defaults_suffix = None

Expand Down Expand Up @@ -643,7 +644,7 @@ def run_cli(self):
def get_message():
prompt = self.get_prompt(self.prompt_format)
if self.prompt_format == self.default_prompt and len(prompt) > self.max_len_prompt:
prompt = self.get_prompt('\\d> ')
prompt = self.get_prompt(self.default_prompt_splitln)
prompt = prompt.replace("\\x1b", "\x1b")
return ANSI(prompt)

Expand Down Expand Up @@ -1150,7 +1151,7 @@ def get_last_query(self):
help='list of DSN configured into the [alias_dsn] section of myclirc file.')
@click.option('--list-ssh-config', 'list_ssh_config', is_flag=True,
help='list ssh configurations in the ssh config (requires paramiko).')
@click.option('-R', '--prompt', 'prompt',
@click.option('-R', '--prompt', 'prompt', default=MyCli.default_prompt,
help='Prompt format (Default: "{0}").'.format(
MyCli.default_prompt))
@click.option('-l', '--logfile', type=click.File(mode='a', encoding='utf-8'),
Expand Down