Skip to content

Commit f6b90ac

Browse files
authored
Merge pull request #5 from Inventitech/release_0.0.3
Release v0.0.3
2 parents d3911f4 + a8a39df commit f6b90ac

File tree

8 files changed

+48
-31
lines changed

8 files changed

+48
-31
lines changed

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ mono: none
66
sudo: required
77
dist: xenial
88
dotnet: 2.2.104
9+
before_install:
10+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get update; fi
11+
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then sudo apt-get install -y appstream; fi
912
script:
1013
- dotnet restore
1114
after_success:

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"preLaunchTask": "build",
1212
// If you have changed target frameworks, make sure to update the program path.
1313
"program": "${workspaceFolder}/bin/Debug/netcoreapp2.2/strans.dll",
14-
"args": ["--example-file", "examples/rules"],
14+
"args": ["--version"],
1515
"cwd": "${workspaceFolder}",
1616
// For more information about the 'console' field, see https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#console-terminal-window
1717
"console": "externalTerminal",

Program.cs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using CommandLine;
88
using CommandLine.Text;
99
using Microsoft.ProgramSynthesis.AST;
10+
using System.Linq;
1011

1112
namespace CommandLine.Text
1213
{
@@ -30,6 +31,7 @@ class Options
3031
[Option("describe", Required = false, HelpText = "Print-out a human-readable description of the inferred program, based on the examples. Do not perform any actual string transformation.")]
3132
public bool describe { get; set; }
3233

34+
3335
[Usage(ApplicationAlias = "strans")]
3436
public static IEnumerable<Example> Examples
3537
{
@@ -39,9 +41,8 @@ public static IEnumerable<Example> Examples
3941
yield return new Example("Usage with multiple examples to infer string transformation rules stored in file examples. Syntax in example is one transformation example per line as before => after", new Options { exampleFile = "examples" });
4042
}
4143
}
42-
43-
4444
}
45+
4546
}
4647

4748
namespace Microsoft.ProgramSynthesis.Transformation.Text
@@ -54,7 +55,17 @@ static int Main(string[] args)
5455
return Parser.Default.ParseArguments<Options>(args)
5556
.MapResult(
5657
options => run(options),
57-
_ => 1);
58+
errors => handleErrors(errors));
59+
}
60+
61+
static int handleErrors(IEnumerable<Error> errors)
62+
{
63+
if (errors.Any(l => l.GetType() == typeof(VersionRequestedError)))
64+
{
65+
Console.Out.WriteLine();
66+
}
67+
68+
return 0;
5869
}
5970

6071
static Program buildProgram(Options options)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ An alias (in your bashrc, ...) can make `strans` integrate seamlessly in
158158
a Unix environment:
159159

160160
```
161-
ALIAS strans="dotnet path/to/strans.dll"
161+
alias strans="dotnet path/to/strans.dll"
162162
```
163163

164164

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- Copyright 2019 Moritz Beller -->
3+
<component type="console-application">
4+
<id>com.inventitech.strans</id>
5+
<name>strans</name>
6+
<summary>Performs string manipulation by learning from the provided examples, instead of explicit programming</summary>
7+
<description>
8+
<p>strans (string transform) is an intuitive string manipulation utility for the shell (primarily Unix, but should work cross-platform). The user does not need to know any programming. All she needs to do is provide strans with a set of examples. strans will automagically learn transformation rules from these examples and apply them to the input given on STDIN.</p>
9+
</description>
10+
<url type="homepage">https://github.com/Inventitech/strans</url>
11+
<metadata_license>CC-BY-SA-4.0</metadata_license>
12+
<project_license>GPL-3.0</project_license>
13+
14+
<screenshots>
15+
<screenshot type="default">
16+
<image>https://github.com/Inventitech/strans/raw/master/strans.gif</image>
17+
</screenshot>
18+
</screenshots>
19+
20+
<provides>
21+
<id>com.inventitech.strans.desktop</id>
22+
<binary>strans-linux.AppImage</binary>
23+
</provides>
24+
<developer_name>Moritz Beller</developer_name>
25+
​<update_contact>moritzbeller_AT_gmx.de</update_contact>
26+
</component>

release/AppDir/usr/share/metainfo/strans.appdata.xml

Lines changed: 0 additions & 23 deletions
This file was deleted.

strans.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<OutputType>Exe</OutputType>
55
<TargetFramework>netcoreapp2.2</TargetFramework>
66
<RuntimeFrameworkVersion>2.2.0</RuntimeFrameworkVersion>
7-
<Version>0.0.2</Version>
7+
<Version>0.0.3</Version>
88
<Copyright>Copyirght (C) 2019 Moritz Beller (Inventitech)</Copyright>
99
<RuntimeIdentifiers>linux-x64;osx-x64</RuntimeIdentifiers>
1010
</PropertyGroup>
@@ -13,7 +13,7 @@
1313
<CFBundleName>strans</CFBundleName>
1414
<CFBundleDisplayName>strans</CFBundleDisplayName>
1515
<CFBundleIdentifier>com.inventitech.strans</CFBundleIdentifier>
16-
<CFBundleVersion>0.0.2</CFBundleVersion>
16+
<CFBundleVersion>0.0.3</CFBundleVersion>
1717
<CFBundlePackageType>AAPL</CFBundlePackageType>
1818
<CFBundleSignature>com.inventitech.strans</CFBundleSignature>
1919
<CFBundleExecutable>strans</CFBundleExecutable>
@@ -27,7 +27,7 @@
2727
<PackageReference Include="CommandLineParser" Version="2.4.3" />
2828
<PackageReference Include="dotnet-bundle" Version="0.9.8" />
2929
<PackageReference Include="Dotnet.Bundle" Version="0.9.8" />
30-
<PackageReference Include="Microsoft.ProgramSynthesis" Version="6.11.0" />
30+
<PackageReference Include="Microsoft.ProgramSynthesis" Version="6.14.6" />
3131
<DotNetCliToolReference Include="dotnet-bundle" Version="*" />
3232
</ItemGroup>
3333

0 commit comments

Comments
 (0)