Skip to content

Commit 13b3fc3

Browse files
committed
Connection string options start at 1 instead of 0 making it more natural for keyboard layout and when there are less than 10 items a key press is enough
1 parent f981950 commit 13b3fc3

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.2.0] - 2025-02-14
9+
10+
- ✨ Connection string options start at 1 instead of 0 making it more natural for keyboard layout
11+
- ✨ Connection string selection only needs a key press when there are less than 10 items
12+
813
## [1.1.0] - 2025-02-11
914

1015
- ✨ Added ability to select auto-detected envvar connection string

FakeMessageGen/Program.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ list of transport configuration to choose from when launched.
9393
or Learning transport.
9494
9595
Azure Service Bus:
96-
96+
9797
Are expected to start with "Endpoint="
9898
9999
RabbitMQ:
@@ -214,14 +214,16 @@ static bool SetupTransport()
214214
for (int i = 0; i < transports.Count; i++)
215215
{
216216
var cyan = Ansi.GetAnsiColor(ConsoleColor.DarkCyan);
217-
Console.WriteLine($" [{cyan}{i}{Ansi.Reset}] {transports[i].key}: {transports[i].type}");
217+
Console.WriteLine($" [{cyan}{i + 11}{Ansi.Reset}] {transports[i].key}: {transports[i].type}");
218218
}
219219

220220
Console.Write("\nOption: ");
221221

222-
var x = int.Parse(Console.ReadLine());
222+
var indexStartAt1 = transports.Count < 10
223+
? int.Parse(Console.ReadKey().KeyChar.ToString())
224+
: int.Parse(Console.ReadLine());
223225

224-
ConnectionString = transports[x].v;
226+
ConnectionString = transports[--indexStartAt1].v;
225227
ConnectionString = Environment.ExpandEnvironmentVariables(ConnectionString);
226228
}
227229

0 commit comments

Comments
 (0)