Skip to content

Commit

Permalink
wargs - fix --from-code arg
Browse files Browse the repository at this point in the history
- Restore wargs command-line argument handling for "-f" and
  "--from-code".
- Add MakeRelease.bat script to make Release ZIP files.
- Add Arm64 to release binaries.
  • Loading branch information
Doug Cook (WINDOWS) committed Jun 19, 2022
1 parent 9418db3 commit 3cc9b58
Show file tree
Hide file tree
Showing 8 changed files with 280 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
*.suo
*.user
[Oo]bjArm64/
[Oo]bjx64/
[Oo]bjWin32/
Release/
.vs/
5 changes: 5 additions & 0 deletions MakeRelease.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
rd /s /q %~dp0objWin32 %~dp0objX64 %~dp0objArm64 %~dp0Release
mkdir %~dp0Release
msbuild %~dp0TextTools.sln -t:Rebuild -p:Configuration=Release;Platform=x86 && zip -j %~dp0Release\TextUtils-X86-32.zip %~dp0objWin32\Release\*.exe
msbuild %~dp0TextTools.sln -t:Rebuild -p:Configuration=Release;Platform=x64 && zip -j %~dp0Release\TextUtils-X86-64.zip %~dp0objX64\Release\*.exe
msbuild %~dp0TextTools.sln -t:Rebuild -p:Configuration=Release;Platform=arm64 && zip -j %~dp0Release\TextUtils-ARM-64.zip %~dp0objArm64\Release\*.exe
14 changes: 14 additions & 0 deletions TextTools.sln
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,46 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|ARM64 = Debug|ARM64
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|ARM64 = Release|ARM64
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|ARM64.ActiveCfg = Debug|ARM64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|ARM64.Build.0 = Debug|ARM64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|x64.ActiveCfg = Debug|x64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|x64.Build.0 = Debug|x64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|x86.ActiveCfg = Debug|Win32
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Debug|x86.Build.0 = Debug|Win32
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|ARM64.ActiveCfg = Release|ARM64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|ARM64.Build.0 = Release|ARM64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|x64.ActiveCfg = Release|x64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|x64.Build.0 = Release|x64
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|x86.ActiveCfg = Release|Win32
{9EDD7581-DF10-4284-8418-D873D09EF4A2}.Release|x86.Build.0 = Release|Win32
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|ARM64.ActiveCfg = Debug|ARM64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|ARM64.Build.0 = Debug|ARM64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|x64.ActiveCfg = Debug|x64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|x64.Build.0 = Debug|x64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|x86.ActiveCfg = Debug|Win32
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Debug|x86.Build.0 = Debug|Win32
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|ARM64.ActiveCfg = Release|ARM64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|ARM64.Build.0 = Release|ARM64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|x64.ActiveCfg = Release|x64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|x64.Build.0 = Release|x64
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|x86.ActiveCfg = Release|Win32
{0B6BBA07-3611-4B20-9E12-9AC1C08C898C}.Release|x86.Build.0 = Release|Win32
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|ARM64.ActiveCfg = Debug|ARM64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|ARM64.Build.0 = Debug|ARM64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|x64.ActiveCfg = Debug|x64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|x64.Build.0 = Debug|x64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|x86.ActiveCfg = Debug|Win32
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Debug|x86.Build.0 = Debug|Win32
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Release|ARM64.ActiveCfg = Release|ARM64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Release|ARM64.Build.0 = Release|ARM64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Release|x64.ActiveCfg = Release|x64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Release|x64.Build.0 = Release|x64
{D21C1E8D-7B31-439D-9B50-CD943BA91DF1}.Release|x86.ActiveCfg = Release|Win32
Expand Down
2 changes: 1 addition & 1 deletion inc/TextToolsCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#pragma once
#include <memory>

#define TEXTTOOLS_VERSION "v1.0.1"
#define TEXTTOOLS_VERSION "v1.0.2"
#define TEXTTOOLS_LICENSE "Distributed under the terms of the MIT License.\nWritten by Doug Cook."

#define TEXTTOOLS_VERSION_STR(toolNameString) "\n" \
Expand Down
83 changes: 83 additions & 0 deletions lib/TextToolsLib.vcxproj
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM64">
<Configuration>Debug</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|ARM64">
<Configuration>Release</Configuration>
<Platform>ARM64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
Expand Down Expand Up @@ -45,13 +53,26 @@
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v143</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
Expand All @@ -66,9 +87,15 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'" Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
Expand All @@ -88,12 +115,24 @@
<IntDir>$(SolutionDir)obj$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>$(SolutionDir)obj$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)obj$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<LinkIncremental>false</LinkIncremental>
<OutDir>$(SolutionDir)obj$(Platform)\$(Configuration)\</OutDir>
<IntDir>$(SolutionDir)obj$(Platform)\$(Configuration)\$(ProjectName)\</IntDir>
<RunCodeAnalysis>true</RunCodeAnalysis>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
Expand Down Expand Up @@ -155,6 +194,25 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<FunctionLevelLinking>true</FunctionLevelLinking>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>../inc</AdditionalIncludeDirectories>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
Expand All @@ -178,6 +236,29 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">
<ClCompile>
<WarningLevel>Level4</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>../inc</AdditionalIncludeDirectories>
<EnforceTypeConversionRules>true</EnforceTypeConversionRules>
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
</ClCompile>
<Link>
<SubSystem>
</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\inc\ArgParser.h" />
<ClInclude Include="..\inc\ClipboardText.h" />
Expand All @@ -198,9 +279,11 @@
<ClCompile Include="CodePageInfo.cpp" />
<ClCompile Include="pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM64'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="TextInput.cpp" />
<ClCompile Include="TextOutput.cpp" />
Expand Down
13 changes: 13 additions & 0 deletions wargs/Program.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,13 @@ wmain(int argc, _In_count_(argc) PWSTR argv[])
{
wargs.SetExitIfSizeExceeded();
}
else if (ap.CurrentArgNameMatches(1, L"from-code"))
{
if (ap.GetLongArgVal(val, false))
{
ap.SetArgErrorIfFalse(wargs.SetInputEncoding(val, "--from-code"));
}
}
else if (ap.CurrentArgNameMatches(1, L"help"))
{
showHelp = true;
Expand Down Expand Up @@ -241,6 +248,12 @@ wmain(int argc, _In_count_(argc) PWSTR argv[])
wargs.SetEofStr(val, "-E");
}
break;
case 'f':
if (ap.ReadShortArgVal(val, false))
{
ap.SetArgErrorIfFalse(wargs.SetInputEncoding(val, "-f"));
}
break;
case 'I':
if (ap.ReadShortArgVal(val, true))
{
Expand Down
Loading

0 comments on commit 3cc9b58

Please sign in to comment.