Skip to content

Commit 43704ce

Browse files
committed
update for the new API
1 parent 908ba71 commit 43704ce

File tree

11 files changed

+51
-40
lines changed

11 files changed

+51
-40
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
bin
22
Debug
33
obj
4-
*.lcpkg
4+
*.lcp

basename.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@ namespace LeoConsole_ExamplePlugin {
77
public class Basename : ICommand {
88
public string Name { get { return "basename"; } }
99
public string Description { get { return "print name with any leading directory components removed"; } }
10-
public Action CommandFunktion { get { return () => Command(); } }
11-
private string[] _InputProperties;
12-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
10+
public Action CommandFunction { get { return () => Command(); } }
11+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
12+
private string[] _Arguments;
13+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1314
public void Command() {
14-
if (_InputProperties.Length < 2) {
15+
if (_Arguments.Length < 2) {
1516
Console.WriteLine("you need to provide an argument");
1617
return;
1718
}
18-
Console.WriteLine(Path.GetFileName(_InputProperties[1]));
19+
Console.WriteLine(Path.GetFileName(_Arguments[1]));
1920
}
2021
}
2122
}

cat.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,17 @@ namespace LeoConsole_ExamplePlugin {
77
public class Cat : ICommand {
88
public string Name { get { return "cat"; } }
99
public string Description { get { return "print contents of a file"; } }
10-
public Action CommandFunktion { get { return () => Command(); } }
11-
private string[] _InputProperties;
12-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
10+
public Action CommandFunction { get { return () => Command(); } }
11+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
12+
private string[] _Arguments;
13+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1314
public void Command() {
14-
if (_InputProperties.Length < 2) {
15+
if (_Arguments.Length < 2) {
1516
Console.WriteLine("you need to provide an argument");
1617
return;
1718
}
1819
try {
19-
Console.WriteLine(File.ReadAllText(_InputProperties[1]));
20+
Console.WriteLine(File.ReadAllText(_Arguments[1]));
2021
} catch (Exception e) {
2122
Console.WriteLine("error: " + e.Message);
2223
}

clear.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ namespace LeoConsole_ExamplePlugin {
77
public class Clear : ICommand {
88
public string Name { get { return "clear"; } }
99
public string Description { get { return "clear the screen"; } }
10-
public Action CommandFunktion { get { return () => Command(); } }
11-
private string[] _InputProperties;
12-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
10+
public Action CommandFunction { get { return () => Command(); } }
11+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
12+
private string[] _Arguments;
13+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1314
public void Command() {
1415
Console.Clear();
1516
}

date.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@ namespace LeoConsole_ExamplePlugin {
77
public class Date : ICommand {
88
public string Name { get { return "date"; } }
99
public string Description { get { return "print current date and time"; } }
10-
public Action CommandFunktion { get { return () => Command(); } }
11-
private string[] _InputProperties;
12-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
10+
public Action CommandFunction { get { return () => Command(); } }
11+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
12+
private string[] _Arguments;
13+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1314

1415
public void Command() {
1516
Console.WriteLine(DateTime.Now.ToString());

echo.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ namespace LeoConsole_ExamplePlugin {
77
public class Echo : ICommand {
88
public string Name { get { return "echo"; } }
99
public string Description { get { return "print the given parameters to the screen"; } }
10-
public Action CommandFunktion { get { return () => Command(); } }
11-
private string[] _InputProperties;
12-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
10+
public Action CommandFunction { get { return () => Command(); } }
11+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
12+
private string[] _Arguments;
13+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1314
public void Command() {
14-
for (int i = 1; i < _InputProperties.Length; i++) {
15-
Console.Write(InputProperties[i] + " ");
15+
for (int i = 1; i < _Arguments.Length; i++) {
16+
Console.Write(Arguments[i] + " ");
1617
}
1718
Console.Write("\n");
1819
}

hostname.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ namespace LeoConsole_ExamplePlugin {
88
public class Hostname : ICommand {
99
public string Name { get { return "hostname"; } }
1010
public string Description { get { return "print computer's hostname"; } }
11-
public Action CommandFunktion { get { return () => Command(); } }
12-
private string[] _InputProperties;
13-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
11+
public Action CommandFunction { get { return () => Command(); } }
12+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
13+
private string[] _Arguments;
14+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1415

1516
public void Command() {
1617
Console.WriteLine(Dns.GetHostName());

manifest.apkg.json renamed to manifest.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
2-
"manifestVersion": 2.1,
2+
"manifestVersion": 3.0,
33
"packageName": "coreutils",
4-
"packageVersion": "0.2.0",
4+
"packageVersion": "0.3.0",
5+
"depends": [],
6+
"compatibleVersions": ["2.0.0"],
57
"build": {
68
"command": "dotnet",
79
"args": ["build", "--nologo"],

printenv.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ namespace LeoConsole_ExamplePlugin {
88
public class Printenv : ICommand {
99
public string Name { get { return "printenv"; } }
1010
public string Description { get { return "print the environment"; } }
11-
public Action CommandFunktion { get { return () => Command(); } }
12-
private string[] _InputProperties;
13-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
11+
public Action CommandFunction { get { return () => Command(); } }
12+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
13+
private string[] _Arguments;
14+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1415
public void Command() {
1516
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) {
1617
Console.WriteLine("{0}={1}", de.Key, de.Value);

sleep.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ namespace LeoConsole_ExamplePlugin {
88
public class Sleep : ICommand {
99
public string Name { get { return "sleep"; } }
1010
public string Description { get { return "do nothing for given number of seconds"; } }
11-
public Action CommandFunktion { get { return () => Command(); } }
12-
private string[] _InputProperties;
13-
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
11+
public Action CommandFunction { get { return () => Command(); } }
12+
public Action HelpFunction { get { return () => Console.WriteLine("not available"); } }
13+
private string[] _Arguments;
14+
public string[] Arguments { get { return _Arguments; } set { _Arguments = value; } }
1415

1516
public void Command() {
1617
int dur;
17-
if (_InputProperties.Length < 2) {
18+
if (_Arguments.Length < 2) {
1819
dur = 1;
1920
} else {
2021
try {
21-
dur = Int32.Parse(_InputProperties[1]);
22+
dur = Int32.Parse(_Arguments[1]);
2223
} catch (Exception e) {
2324
Console.WriteLine("invalid number provided");
2425
return;

0 commit comments

Comments
 (0)