Merge branch 'master' into master

This commit is contained in:
Dustin L. Howett (MSFT) 2019-03-28 16:59:03 -07:00 committed by GitHub
commit a30f56645a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 223 additions and 173 deletions

View file

@ -9,6 +9,6 @@ namespace ColorTool
{
string Name { get; }
ColorScheme ParseScheme(string schemeName, bool reportErrors = true);
ColorScheme ParseScheme(string schemeName, bool reportErrors = false);
}
}

View file

@ -76,7 +76,7 @@ namespace ColorTool
return Scheme.GetSearchPaths(schemeName, ".ini").FirstOrDefault(File.Exists);
}
public ColorScheme ParseScheme(string schemeName, bool reportErrors = true)
public ColorScheme ParseScheme(string schemeName, bool reportErrors = false)
{
bool success = true;

View file

@ -60,7 +60,7 @@ namespace ColorTool
return null;
}
public ColorScheme ParseScheme(string schemeName, bool reportErrors = true)
public ColorScheme ParseScheme(string schemeName, bool reportErrors = false)
{
XmlDocument xmlDoc = loadJsonFile(schemeName);
if (xmlDoc == null) return null;

View file

@ -106,6 +106,7 @@ namespace ColorTool
};
static bool quietMode = false;
static bool reportErrors = false;
static bool setDefaults = false;
static bool setProperties = true;
static bool setUnixStyle = false;
@ -486,6 +487,10 @@ namespace ColorTool
case "--current":
PrintTable();
return;
case "-e":
case "--errors":
reportErrors = true;
break;
case "-q":
case "--quiet":
quietMode = true;
@ -539,7 +544,7 @@ namespace ColorTool
string schemeName = args[args.Length - 1];
ColorScheme colorScheme = GetScheme(schemeName);
ColorScheme colorScheme = GetScheme(schemeName, reportErrors);
if (colorScheme == null)
{
@ -571,7 +576,7 @@ namespace ColorTool
.Select(t => (ISchemeParser)Activator.CreateInstance(t));
}
private static ColorScheme GetScheme(string schemeName, bool reportErrors = true)
private static ColorScheme GetScheme(string schemeName, bool reportErrors = false)
{
foreach (var parser in GetParsers())
{

View file

@ -141,17 +141,19 @@
<value>Usage:
colortool.exe [options] &lt;schemename&gt;
ColorTool is a utility for helping to set the color palette of the Windows Console.
By default, applies the colors in the specified .itermcolors or .ini file to the current console window.
By default, applies the colors in the specified .itermcolors, .json or .ini file to the current console window.
This does NOT save the properties automatically. For that, you'll need to open the properties sheet and hit "Ok".
Included should be a `schemes/` directory with a selection of schemes of both formats for examples.
Feel free to add your own preferred scheme to that directory.
Arguments:
&lt;schemename&gt;: The name of a color scheme. ct will try to first load it as an .itermcolors color scheme.
If that fails, it will look for it as an .ini file color scheme.
&lt;schemename&gt;: The name of a color scheme. ct will try to first load it as an .ini file color scheme
If that fails, it will look for it as a .json file color scheme
If that fails, it will look for it as an .itermcolors file color scheme.
Options:
-?, --help : Display this help message
-c, --current : Print the color table for the currently applied scheme
-q, --quiet : Don't print the color table after applying
-e, --errors : Report scheme parsing errors on the console
-d, --defaults : Apply the scheme to only the defaults in the registry
-b, --both : Apply the scheme to both the current console and the defaults.
-x, --xterm : Set the colors using VT sequences. Used for setting the colors in WSL.

View file

@ -99,7 +99,7 @@ namespace ColorTool
}
public ColorScheme ParseScheme(string schemeName, bool reportErrors = true)
public ColorScheme ParseScheme(string schemeName, bool reportErrors = false)
{
XmlDocument xmlDoc = loadXmlScheme(schemeName); // Create an XML document object
if (xmlDoc == null) return null;

View file

@ -0,0 +1,37 @@
REM @echo off
REM This script copies the files to have different paths to be signed and copies them back
if "%2" == "" goto :usage
if "%1" == "sign" goto :sign
if "%1" == "afterSign" goto :afterSign
goto :usage
:sign
pushd "%2"
mkdir tosign
call :checkedCopy ..\b\Release\anycpu\ColorTool.exe tosign\ColorTool.exe
popd
goto :end
:afterSign
pushd "%2"
call :checkedCopy signed\ColorTool.exe ..\b\Release\anycpu\ColorTool.exe
popd
goto :end
:checkedCopy
copy %1 %2
if %errorlevel% NEQ 0 (
popd
exit 1
)
exit /b
:usage
echo "Usage: CopySignFiles <sign| afterSign> <root of the repo>"
echo "Will copy the binary release from <root>\Release to be sent to signed"
:end

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<SignConfigXML>
<job platform="anycpu" configuration="release" dest="__RELBINPATH__\..\..\..\s\signed" jobname="Console ColorTool" approvers="miniksa;migrie;duhowett;austdi">
<file src="__RELBINPATH__\..\..\..\s\tosign\colortool.exe" signType="Authenticode" dest="__RELBINPATH__\..\..\..\s\signed\colortool.exe" />
</job>
</SignConfigXML>