Add developers startup arg (#997)

This commit is contained in:
Charles Gagnon
2020-07-23 16:09:58 -07:00
committed by GitHub
parent b42940c98a
commit 9fba9b1955
3 changed files with 43 additions and 8 deletions

View File

@@ -2,7 +2,9 @@
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using System.Globalization;
using System.Linq;
using Microsoft.SqlTools.Hosting.Utility;
namespace Microsoft.SqlTools.ServiceLayer.Utility
@@ -11,8 +13,36 @@ namespace Microsoft.SqlTools.ServiceLayer.Utility
{
internal const string ServiceLayerServiceName = "MicrosoftSqlToolsServiceLayer.exe";
public ServiceLayerCommandOptions(string[] args) : base(args, ServiceLayerServiceName)
private static readonly string[] serviceLayerCommandArgs = { "-d", "--developers" };
/**
* List of contributors to this project, used as part of the onboarding process.
*/
private readonly string[] contributors = new string[] {
// Put your Github username here!
"Charles-Gagnon"
};
public ServiceLayerCommandOptions(string[] args) : base(args.Where(arg => !serviceLayerCommandArgs.Contains(arg)).ToArray(), ServiceLayerServiceName)
{
for (int i = 0; i < args.Length; ++i)
{
string arg = args[i].ToLowerInvariant();
switch (arg)
{
case "-d":
case "--developers":
Console.WriteLine();
Console.WriteLine("**********************************************************************************");
Console.WriteLine("These are some of the developers who have contributed to this project - thank you!");
Console.WriteLine("**********************************************************************************");
Console.WriteLine();
Console.WriteLine(string.Join(Environment.NewLine, contributors.Select(contributor => $"\t{contributor}")));
this.ShouldExit = true;
break;
}
}
}
public override void SetLocale(string locale)