Skip to content

Commit

Permalink
add printenv
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcoder04 committed Feb 2, 2022
1 parent 4e29c74 commit 3d78f09
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public void PluginMain() {
_Commands.Add(new Echo());
_Commands.Add(new Hostname());
_Commands.Add(new Ls());
_Commands.Add(new Printenv());
_Commands.Add(new Yes());
}
}
Expand Down
22 changes: 22 additions & 0 deletions printenv.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System.IO;
using System.Collections;
using ILeoConsole;
using ILeoConsole.Plugin;
using ILeoConsole.Core;

namespace LeoConsole_ExamplePlugin {
public class Printenv : ICommand {
public string Name { get { return "printenv"; } }
public string Description { get { return "print the environment"; } }
public Action CommandFunktion { get { return () => Command(); } }
private string[] _InputProperties;
public string[] InputProperties { get { return _InputProperties; } set { _InputProperties = value; } }
public void Command() {
foreach (DictionaryEntry de in Environment.GetEnvironmentVariables()) {
Console.WriteLine("{0}={1}", de.Key, de.Value);
}
}
}
}

// vim: tabstop=2 softtabstop=2 shiftwidth=2 expandtab

0 comments on commit 3d78f09

Please sign in to comment.