Skip to content

Commit

Permalink
Add option -q|--quiet
Browse files Browse the repository at this point in the history
  • Loading branch information
huangxiangyao committed May 6, 2022
1 parent b01d66c commit 64852eb
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions src/IpFix/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,12 @@ static void Main(string[] args)

if (args.Length == 0)
{
Console.WriteLine("Usage: ipfix [domain-name-1] [domain-name-2] ... [domain-name-n]");
Console.WriteLine("Usage: ipfix [Option] [domain-name-1] [domain-name-2] ... [domain-name-n]");
Console.WriteLine();
Console.WriteLine("[Option]");
Console.WriteLine(" -q|--quiet Run in quiet mode.");
Console.WriteLine();
Console.WriteLine("Description:");
Console.WriteLine("Step 1: Fetch the IP address from a resolver on the outernet;");
Console.WriteLine("Step 2: Add or update the record in the `hosts` file");
Console.WriteLine("Step 3: Run `ipconfig /flushdns`");
Expand All @@ -60,14 +64,20 @@ static void Main(string[] args)
}
finally
{
//try
//{
// var isInConsole = Console.CursorLeft >= int.MinValue;
// Console.WriteLine();
// Console.WriteLine("Press any key to exit...");
// Console.ReadKey();
//}
//catch { }
if ((args?.Contains("-q") ?? false)
|| (args?.Contains("--quiet") ?? false))
{ }
else
{
try
{
var isInConsole = Console.CursorLeft >= int.MinValue;
Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}
catch { }
}
}
}

Expand Down

0 comments on commit 64852eb

Please sign in to comment.