Skip to content

Commit 3d78f09

Browse files
committed
add printenv
1 parent 4e29c74 commit 3d78f09

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

plugin.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ public void PluginMain() {
3434
_Commands.Add(new Echo());
3535
_Commands.Add(new Hostname());
3636
_Commands.Add(new Ls());
37+
_Commands.Add(new Printenv());
3738
_Commands.Add(new Yes());
3839
}
3940
}

printenv.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System.IO;
2+
using System.Collections;
3+
using ILeoConsole;
4+
using ILeoConsole.Plugin;
5+
using ILeoConsole.Core;
6+
7+
namespace LeoConsole_ExamplePlugin {
8+
public class Printenv : ICommand {
9+
public string Name { get { return "printenv"; } }
10+
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; } }
14+
public void Command() {
15+
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) {
16+
Console.WriteLine("{0}={1}", de.Key, de.Value);
17+
}
18+
}
19+
}
20+
}
21+
22+
// vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab

0 commit comments

Comments
 (0)