Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit c87d73e

Browse files
author
mikkomaa
committed
Ask server first from user in login
1 parent 9d98d43 commit c87d73e

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ Now that you've installed tmc-cli, you can view all available commands by runnin
4646
Once installation is complete, you can log in using `tmc login`. This saves your TMC login information to a configuration file in ~/.config/tmc-cli/ (or %LOCALAPPDATA% on Windows) - you will only have to log in once.
4747
```
4848
~ $ tmc login
49-
username: my-username
50-
password:
5149
server address:
50+
username:
51+
password:
5252
Login successful.
5353
```
5454

src/main/java/fi/helsinki/cs/tmc/cli/command/LoginCommand.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,10 @@ public void getOptions(Options options) {
3636
@Override
3737
public void run(CommandLine args, Io io) {
3838
this.io = io;
39+
String serverAddress = getLoginInfo(args, "s", "server address: ");
3940
String username = getLoginInfo(args, "u", "username: ");
4041
String password = getLoginInfo(args, "p", "password: ");
41-
String serverAddress = getLoginInfo(args, "s", "server address: ");
42-
42+
4343
Settings settings = new Settings(serverAddress, username, password);
4444
if (loginPossible(settings) && saveLoginSettings(settings)) {
4545
io.println("Login successful.");

0 commit comments

Comments
 (0)