Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .vs/ProjectSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"CurrentProjectSetting": null
}
Binary file modified .vs/Replify.Net/DesignTimeBuild/.dtbcache
Binary file not shown.
Binary file modified .vs/Replify.Net/v15/.suo
Binary file not shown.
Binary file modified .vs/Replify.Net/v15/Server/sqlite3/storage.ide
Binary file not shown.
Binary file modified .vs/Replify.Net/v15/Server/sqlite3/storage.ide-shm
Binary file not shown.
Binary file modified .vs/Replify.Net/v15/Server/sqlite3/storage.ide-wal
Binary file not shown.
6 changes: 6 additions & 0 deletions .vs/VSWorkspaceState.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"ExpandedNodes": [
""
],
"PreviewInSolutionExplorer": false
}
Binary file added .vs/slnx.sqlite
Binary file not shown.
9 changes: 7 additions & 2 deletions Replify.Net.ConsoleTest/Commands/VersionCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@

namespace Replify.Net.ConsoleTest.Commands
{
[Command("version")]
[Command("version", helpText: "This text is for the Version Command")]
public class VersionCommand : BaseCommand
{

[Parameter("deneme", ShortKey = "d", HelpText = "Deneme Property'si")]
public int Deneme { get; set; }


public override void Run(String param)
{
var version = Assembly.GetExecutingAssembly().ImageRuntimeVersion;
ReplifyConsole.WriteLine(version);
}
}
}
}
14 changes: 10 additions & 4 deletions Replify.Net.ConsoleTest/Commands/ViewFileCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,20 @@

namespace Replify.Net.ConsoleTest.Commands
{
[Command("view")]
[Command("view", helpText: "This text is for the ViewFile Command")]
public class ViewFileCommand : BaseCommand
{
[Parameter("line", ShortKey = "l")]
{
[Parameter("line", ShortKey = "l", HelpText = "Sayfaya ait gosterilecek satir sayisi")]
public String LineCount { get; set; }

[Parameter("deneme", ShortKey = "d", HelpText = "Deneme Property'si")]
public int Deneme { get; set; }

[Parameter("palamut", ShortKey = "p", HelpText = "Palamut Propertysi")]
public int Palamut { get; set; }

public override void Run(String fileName)
{
{
Console.WriteLine("file command executed: " + fileName + " " + this.LineCount + " lines");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
".NETCoreApp,Version=v2.1": {
"Replify.Net.ConsoleTest/1.0.0": {
"dependencies": {
"Replify.Net": "1.3.0"
"Replify.Net": "1.3.1"
},
"runtime": {
"Replify.Net.ConsoleTest.dll": {}
}
},
"Replify.Net/1.3.0": {
"Replify.Net/1.3.1": {
"runtime": {
"Replify.Net.dll": {}
}
Expand All @@ -27,7 +27,7 @@
"serviceable": false,
"sha512": ""
},
"Replify.Net/1.3.0": {
"Replify.Net/1.3.1": {
"type": "project",
"serviceable": false,
"sha512": ""
Expand Down
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"runtimeOptions": {
"additionalProbingPaths": [
"C:\\Users\\dtmebaran\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\dtmebaran\\.nuget\\packages",
"C:\\Users\\dtshamzacebi\\.dotnet\\store\\|arch|\\|tfm|",
"C:\\Users\\dtshamzacebi\\.nuget\\packages",
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
]
}
Expand Down
Binary file modified Replify.Net.ConsoleTest/bin/Debug/netcoreapp2.1/Replify.Net.dll
Binary file not shown.
Binary file modified Replify.Net.ConsoleTest/bin/Debug/netcoreapp2.1/Replify.Net.pdb
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1 +1 @@
f465cda7e8e1ddcfea0c92e3dd49c764cb7d915d
b493494d93689c2137c079e73b09643e1cfce25d
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,17 @@ D:\src\digiturk\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Repl
D:\src\digiturk\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.csproj.CopyComplete
D:\src\digiturk\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.dll
D:\src\digiturk\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.pdb
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.deps.json
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.runtimeconfig.json
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.runtimeconfig.dev.json
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.dll
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.pdb
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.dll
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\bin\Debug\netcoreapp2.1\Replify.Net.pdb
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.csprojAssemblyReference.cache
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.csproj.CoreCompileInputs.cache
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.AssemblyInfoInputs.cache
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.AssemblyInfo.cs
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.csproj.CopyComplete
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.dll
C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\Debug\netcoreapp2.1\Replify.Net.ConsoleTest.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Reflection;

[assembly: System.Reflection.AssemblyCompanyAttribute("Replify.Net.ConsoleTest")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyProductAttribute("Replify.Net.ConsoleTest")]
[assembly: System.Reflection.AssemblyTitleAttribute("Replify.Net.ConsoleTest")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

// Generated by the MSBuild WriteCodeFragment class.

Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e5d21af54f2424b64f32007d00879d4cd4d7f443
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e419803dff1616cbd7c145cd9c2c1667c7c61505
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": 1,
"dgSpecHash": "M77zwiVtut6E7X5+DzGRdZVy8pN0c3uv0tWi7CsxCSWDr1c1k4NbnFnwsoE31oDEqpr/009rU8K/FnyBOVDHDw==",
"dgSpecHash": "1u7PvcVnRXtT+F9A09t8/f3PasXh+WgtegqtBzD4yGzMKBDp7Zbl896xDmQG9Xo8m4jm2GBeiH7k6dlDPStMtw==",
"success": true
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">D:\src\digiturk\Replify.Net\Replify.Net.ConsoleTest\obj\project.assets.json</ProjectAssetsFile>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">C:\Users\dtshamzacebi\Source\Repos\Hamzacebi\Replify.Net\Replify.Net.ConsoleTest\obj\project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\dtmebaran\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\dtshamzacebi\.nuget\packages\;C:\Program Files\dotnet\sdk\NuGetFallbackFolder</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">4.9.3</NuGetToolVersion>
</PropertyGroup>
Expand Down
18 changes: 10 additions & 8 deletions Replify.Net.ConsoleTest/obj/project.assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -704,37 +704,38 @@
]
},
"packageFolders": {
"C:\\Users\\dtmebaran\\.nuget\\packages\\": {},
"C:\\Users\\dtshamzacebi\\.nuget\\packages\\": {},
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "D:\\src\\digiturk\\Replify.Net\\Replify.Net.ConsoleTest\\Replify.Net.ConsoleTest.csproj",
"projectUniqueName": "C:\\Users\\dtshamzacebi\\Source\\Repos\\Hamzacebi\\Replify.Net\\Replify.Net.ConsoleTest\\Replify.Net.ConsoleTest.csproj",
"projectName": "Replify.Net.ConsoleTest",
"projectPath": "D:\\src\\digiturk\\Replify.Net\\Replify.Net.ConsoleTest\\Replify.Net.ConsoleTest.csproj",
"packagesPath": "C:\\Users\\dtmebaran\\.nuget\\packages\\",
"outputPath": "D:\\src\\digiturk\\Replify.Net\\Replify.Net.ConsoleTest\\obj\\",
"projectPath": "C:\\Users\\dtshamzacebi\\Source\\Repos\\Hamzacebi\\Replify.Net\\Replify.Net.ConsoleTest\\Replify.Net.ConsoleTest.csproj",
"packagesPath": "C:\\Users\\dtshamzacebi\\.nuget\\packages\\",
"outputPath": "C:\\Users\\dtshamzacebi\\Source\\Repos\\Hamzacebi\\Replify.Net\\Replify.Net.ConsoleTest\\obj\\",
"projectStyle": "PackageReference",
"fallbackFolders": [
"C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
],
"configFilePaths": [
"C:\\Users\\dtmebaran\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Users\\dtshamzacebi\\AppData\\Roaming\\NuGet\\NuGet.Config",
"C:\\Program Files (x86)\\NuGet\\Config\\Microsoft.VisualStudio.Offline.config"
],
"originalTargetFrameworks": [
"netcoreapp2.1"
],
"sources": {
"C:\\Program Files (x86)\\Microsoft SDKs\\NuGetPackages\\": {},
"http://dtl1tfsbuild2:8081/repository/digiturk-nuget": {},
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"netcoreapp2.1": {
"projectReferences": {
"D:\\src\\digiturk\\Replify.Net\\Replify.Net\\Replify.Net.csproj": {
"projectPath": "D:\\src\\digiturk\\Replify.Net\\Replify.Net\\Replify.Net.csproj"
"C:\\Users\\dtshamzacebi\\Source\\Repos\\Hamzacebi\\Replify.Net\\Replify.Net\\Replify.Net.csproj": {
"projectPath": "C:\\Users\\dtshamzacebi\\Source\\Repos\\Hamzacebi\\Replify.Net\\Replify.Net\\Replify.Net.csproj"
}
}
}
Expand All @@ -749,6 +750,7 @@
"netcoreapp2.1": {
"dependencies": {
"Microsoft.NETCore.App": {
"suppressParent": "All",
"target": "Package",
"version": "[2.1.0, )",
"autoReferenced": true
Expand Down
26 changes: 25 additions & 1 deletion Replify.Net/BaseCommand.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Reflection;

namespace Replify.Net
{
using Extensions;
public abstract class BaseCommand
{
abstract public void Run(String param = "");
}

[Parameter(key: "help", ShortKey = "h")]
public virtual String Help { set { this.WriteAllSubCommandForACommand(); } }

protected void WriteAllSubCommandForACommand()
{
var commandType = this.GetType();
this.WriteAllSubCommands(properties: commandType.GetProperties());
}

protected void WriteAllSubCommands(PropertyInfo[] properties)
{
foreach (var property in properties)
{
if (property.Name == "Help") continue;

var getPropertyAttributes = property.GetAttribute<ParameterAttribute>();
if (getPropertyAttributes == null) continue;

ConsoleExtensions.WriteLineInfo($"--{getPropertyAttributes.Key}\t\t--{getPropertyAttributes.ShortKey}\t\t{(getPropertyAttributes.Required == true ? "is required" : "is optional") }\t\t{getPropertyAttributes.HelpText}");
}
}
}
}
6 changes: 4 additions & 2 deletions Replify.Net/CommandAttribute.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ namespace Replify.Net
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class CommandAttribute : Attribute
{
public CommandAttribute(String command)
public CommandAttribute(String command, String helpText = default(string))
{
this.Command = command;
this.HelpText = helpText;
}
public String Command { get; set; }

public String Command { get; set; }
public String HelpText { get; set; } = string.Empty;
}
}
2 changes: 1 addition & 1 deletion Replify.Net/Commands/ExitCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ public class ExitCommand : BaseCommand
public override void Run(String name)
{
}
}
}
}
28 changes: 28 additions & 0 deletions Replify.Net/Commands/HelpCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Replify.Net.Commands
{
using Extensions;

[Command(command: "help")]
public class HelpCommand : BaseCommand
{
public override void Run(string param = "")
{
var allCommands = Replify.AllCommands();
foreach (var command in allCommands)
{
var getCommandAttributes = command.Value.GetAttribute<CommandAttribute>();
ConsoleExtensions.WriteLineInfo($"{command.Key}\t\t{getCommandAttributes.HelpText}");
ConsoleExtensions.WriteLineInfo(value: "------------------------------------------");
this.WriteAllSubCommands(command.Value.GetProperties());
ConsoleExtensions.WriteLineInfo(value: "==========================================");
}
}



}
}
Loading