File tree Expand file tree Collapse file tree 11 files changed +51
-40
lines changed Expand file tree Collapse file tree 11 files changed +51
-40
lines changed Original file line number Diff line number Diff line change 1
1
bin
2
2
Debug
3
3
obj
4
- * .lcpkg
4
+ * .lcp
Original file line number Diff line number Diff line change @@ -7,15 +7,16 @@ namespace LeoConsole_ExamplePlugin {
7
7
public class Basename : ICommand {
8
8
public string Name { get { return "basename" ; } }
9
9
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 ; } }
13
14
public void Command ( ) {
14
- if ( _InputProperties . Length < 2 ) {
15
+ if ( _Arguments . Length < 2 ) {
15
16
Console . WriteLine ( "you need to provide an argument" ) ;
16
17
return ;
17
18
}
18
- Console . WriteLine ( Path . GetFileName ( _InputProperties [ 1 ] ) ) ;
19
+ Console . WriteLine ( Path . GetFileName ( _Arguments [ 1 ] ) ) ;
19
20
}
20
21
}
21
22
}
Original file line number Diff line number Diff line change @@ -7,16 +7,17 @@ namespace LeoConsole_ExamplePlugin {
7
7
public class Cat : ICommand {
8
8
public string Name { get { return "cat" ; } }
9
9
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 ; } }
13
14
public void Command ( ) {
14
- if ( _InputProperties . Length < 2 ) {
15
+ if ( _Arguments . Length < 2 ) {
15
16
Console . WriteLine ( "you need to provide an argument" ) ;
16
17
return ;
17
18
}
18
19
try {
19
- Console . WriteLine ( File . ReadAllText ( _InputProperties [ 1 ] ) ) ;
20
+ Console . WriteLine ( File . ReadAllText ( _Arguments [ 1 ] ) ) ;
20
21
} catch ( Exception e ) {
21
22
Console . WriteLine ( "error: " + e . Message ) ;
22
23
}
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ namespace LeoConsole_ExamplePlugin {
7
7
public class Clear : ICommand {
8
8
public string Name { get { return "clear" ; } }
9
9
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 ; } }
13
14
public void Command ( ) {
14
15
Console . Clear ( ) ;
15
16
}
Original file line number Diff line number Diff line change @@ -7,9 +7,10 @@ namespace LeoConsole_ExamplePlugin {
7
7
public class Date : ICommand {
8
8
public string Name { get { return "date" ; } }
9
9
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 ; } }
13
14
14
15
public void Command ( ) {
15
16
Console . WriteLine ( DateTime . Now . ToString ( ) ) ;
Original file line number Diff line number Diff line change @@ -7,12 +7,13 @@ namespace LeoConsole_ExamplePlugin {
7
7
public class Echo : ICommand {
8
8
public string Name { get { return "echo" ; } }
9
9
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 ; } }
13
14
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 ] + " " ) ;
16
17
}
17
18
Console . Write ( "\n " ) ;
18
19
}
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ namespace LeoConsole_ExamplePlugin {
8
8
public class Hostname : ICommand {
9
9
public string Name { get { return "hostname" ; } }
10
10
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 ; } }
14
15
15
16
public void Command ( ) {
16
17
Console . WriteLine ( Dns . GetHostName ( ) ) ;
Original file line number Diff line number Diff line change 1
1
{
2
- "manifestVersion" : 2.1 ,
2
+ "manifestVersion" : 3.0 ,
3
3
"packageName" : " coreutils" ,
4
- "packageVersion" : " 0.2.0" ,
4
+ "packageVersion" : " 0.3.0" ,
5
+ "depends" : [],
6
+ "compatibleVersions" : [" 2.0.0" ],
5
7
"build" : {
6
8
"command" : " dotnet" ,
7
9
"args" : [" build" , " --nologo" ],
Original file line number Diff line number Diff line change @@ -8,9 +8,10 @@ namespace LeoConsole_ExamplePlugin {
8
8
public class Printenv : ICommand {
9
9
public string Name { get { return "printenv" ; } }
10
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 ; } }
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 ; } }
14
15
public void Command ( ) {
15
16
foreach ( DictionaryEntry de in Environment . GetEnvironmentVariables ( ) ) {
16
17
Console . WriteLine ( "{0}={1}" , de . Key , de . Value ) ;
Original file line number Diff line number Diff line change @@ -8,17 +8,18 @@ namespace LeoConsole_ExamplePlugin {
8
8
public class Sleep : ICommand {
9
9
public string Name { get { return "sleep" ; } }
10
10
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 ; } }
14
15
15
16
public void Command ( ) {
16
17
int dur ;
17
- if ( _InputProperties . Length < 2 ) {
18
+ if ( _Arguments . Length < 2 ) {
18
19
dur = 1 ;
19
20
} else {
20
21
try {
21
- dur = Int32 . Parse ( _InputProperties [ 1 ] ) ;
22
+ dur = Int32 . Parse ( _Arguments [ 1 ] ) ;
22
23
} catch ( Exception e ) {
23
24
Console . WriteLine ( "invalid number provided" ) ;
24
25
return ;
You can’t perform that action at this time.
0 commit comments