From be3a1b51a6e4a056f97ae57b9e6ae477f4797292 Mon Sep 17 00:00:00 2001 From: levlam Date: Wed, 14 Mar 2018 15:12:30 +0300 Subject: [PATCH] Slightly better commandLine in Java example. GitOrigin-RevId: 0df474b7b9f4ded67c9c6a61fe07f68433522644 --- example/java/org/drinkless/tdlib/example/Example.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/example/java/org/drinkless/tdlib/example/Example.java b/example/java/org/drinkless/tdlib/example/Example.java index 23ca17d9e..c9af2821d 100644 --- a/example/java/org/drinkless/tdlib/example/Example.java +++ b/example/java/org/drinkless/tdlib/example/Example.java @@ -51,6 +51,7 @@ public final class Example { private static final Console console = System.console(); private static final String newLine = System.getProperty("line.separator"); + private static final String commandsLine = "Enter command (gcs - GetChats, gc - GetChat, me - GetMe, sm - SendMessage, lo - LogOut, q - Quit): "; static { System.loadLibrary("tdjni"); @@ -59,6 +60,10 @@ public final class Example { private static void print(String str) { System.out.println(); System.out.println(str); + if (haveAuthorization) + { + System.out.print(commandsLine); + } } private static void setChatOrder(TdApi.Chat chat, long order) { @@ -162,7 +167,7 @@ public final class Example { } private static void getCommand() { - String command = console.readLine("Enter command (gcs - GetChats, gc - GetChat, me - GetMe, sm - SendMessage, lo - LogOut, q - Quit): "); + String command = console.readLine(commandsLine); String[] commands = command.split(" ", 2); try { switch (commands[0]) {