Skip to content

Commit

Permalink
Code Cleanup and fix issue with CLI builds
Browse files Browse the repository at this point in the history
  • Loading branch information
bijij committed Jan 22, 2021
1 parent 37843a6 commit 482f330
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/bottom.exe
asset_path: build/Bottom.CLI.exe
asset_name: bottom_win-x64.exe
asset_content_type: application/octet-stream
- name: Upload Linux Build
Expand All @@ -44,7 +44,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: build/bottom
asset_path: build/Bottom.CLI
asset_name: bottom_linux-x64
asset_content_type: application/octet-stream
- name: Publish NuGet Package
Expand Down
4 changes: 2 additions & 2 deletions src/Bottom.CLI/Bottom.CLI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<RootNamespace>Bottom.CLI</RootNamespace>
<StartupObject>Bottom.CLI.Program</StartupObject>
<Version>1.1.0</Version>
<AssemblyName>bottom</AssemblyName>
<Version>2.0.0</Version>
<AssemblyName>Bottom.CLI</AssemblyName>
</PropertyGroup>

<ItemGroup>
Expand Down
20 changes: 11 additions & 9 deletions src/Bottom.CLI/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,24 @@ static int Main(string[] args)
RootCommand rootCommand = new RootCommand
{
new Option<bool>(
new string[] {"-b", "--bottomify"},
new string[] { "-b", "--bottomify" },
description: "Translate text to bottom"),
new Option<bool>(
new string[] {"-r", "--regress"},
new Option<bool>(
new string[] { "-r", "--regress" },
description: "Translate bottom to human-readable text (futile)"),
new Option<FileInfo>(
new string[] {"-i", "--input"},
new string[] { "-i", "--input" },
description: "Input file [default: stdin]"),
new Option<FileInfo>(
new string[] {"-o", "--output"},
new Option<FileInfo>(
new string[] { "-o", "--output" },
description: "Output file [default: stdout]"),
new Argument<string>(
new Argument<string>(
"text",
getDefaultValue: () => null
)
};

rootCommand.Name = "bottom";
rootCommand.Description = "Fantastic (maybe) CLI for translating between bottom and human-readable text";

rootCommand.Handler = CommandHandler.Create<bool, bool, FileInfo, FileInfo, string>((bottomify, regress, input, output, text) =>
Expand All @@ -54,7 +55,8 @@ static int Main(string[] args)
return;
}
if (!(input is null)) {
if (!(input is null))
{
if (!input.Exists)
{
Console.Error.WriteLine($"Input file \"{input.FullName}\" does not exist.");
Expand All @@ -78,7 +80,7 @@ static int Main(string[] args)
{
using StreamWriter sw = output.CreateText();
sw.Write(result);
}
}
else
{
Console.WriteLine(result);
Expand Down
5 changes: 2 additions & 3 deletions src/Bottom/Bottom.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public static string encode_byte(byte value)
}


public static byte decode_byte(string input)
public static byte decode_byte(string input)
{
if (_emoji_to_byte.ContainsKey(input))
{
Expand Down Expand Up @@ -74,11 +74,10 @@ private static string ByteToEmoji(byte value)
{
to_push = mapping.Value;
subtract_by = mapping.Key;
goto push;
break;
}
}

push:;
buffer.Append(to_push);
value -= subtract_by;
}
Expand Down
4 changes: 2 additions & 2 deletions src/Bottom/Bottom.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyName>Bottom</AssemblyName>
<RootNamespace>Bottom</RootNamespace>
<Version>2.0.0</Version>
<Version>2.0.1</Version>
<PackageId>Bottom.NET</PackageId>
<Authors>Bottom Software Foundation</Authors>
<Product>Bottom.NET</Product>
<Description>Bottom encoding utility functions for .NET</Description>
<Copyright>2021</Copyright>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<AssemblyVersion>2.0.0.0</AssemblyVersion>
<AssemblyVersion>2.0.1.0</AssemblyVersion>
<PackageProjectUrl>https://github.com/bottom-software-foundation/bottom-dotnet/</PackageProjectUrl>
<PackageIcon>logo.png</PackageIcon>
<RepositoryUrl>https://github.com/bottom-software-foundation/bottom-dotnet/</RepositoryUrl>
Expand Down

0 comments on commit 482f330

Please sign in to comment.