diff --git a/tgcli/tgcli.cs b/tgcli/tgcli.cs index fad75dd..153f649 100644 --- a/tgcli/tgcli.cs +++ b/tgcli/tgcli.cs @@ -27,9 +27,10 @@ namespace tgcli; // ReSharper disable once InconsistentNaming public static class tgcli { - public const bool lockInputToBottom = true; - public static volatile Td.TdClient client = new(); - public static string dbdir = ""; + public const string version = "0.4a"; + public static volatile bool lockInputToBottom; + public static volatile Td.TdClient client = new(); + public static string dbdir = ""; public static volatile bool authorized; public static volatile string connectionState = "Connecting"; public static long currentChatId = 0; @@ -47,8 +48,24 @@ public static class tgcli { public static volatile object @lock = new(); private static void Main(string[] args) { - if (args.Length == 1 && args[0] == "-s") + if (args.Contains("-s")) silent = true; + + if (args.Contains("-l")) + lockInputToBottom = true; + + if (args.Contains("-h") || args.Contains("-?") || args.Contains("--help")) { + Console.WriteLine($""" + tgcli v{version} + Laura Hausmann + Source Code: https://git.ztn.sh/zotan/tgcli + + Arguments: + -s Silent mode. Disables terminal bell on new message. + -l Locks input line to bottom, like in an IRC client. + """); + return; + } dbdir = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? $"{Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)}{Path.DirectorySeparatorChar}.tgcli" @@ -361,7 +378,7 @@ public static class tgcli { SystemLanguageCode = "en_US", DeviceModel = Environment.MachineName, SystemVersion = ".NET Core CLR " + Environment.Version, - ApplicationVersion = "0.3a", + ApplicationVersion = version, EnableStorageOptimizer = true, UseSecretChats = true });