Skip to content

Commit b86c30f

Browse files
Add debug mode option
1 parent 36d1563 commit b86c30f

File tree

5 files changed

+21
-4
lines changed

5 files changed

+21
-4
lines changed

FetchFolderCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ public override void Execute()
1818
{
1919
var ftpClient = new FtpClient(Host, UserName, Password);
2020

21+
if (DebugMode)
22+
ftpClient.OnLogEvent += (level, s) => Console.WriteLine($"{level}: {s}");
23+
2124
try
2225
{
2326
if (EnableSsl)

FileUploadCommand.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ public override void Execute()
2525
{
2626
var ftpClient = new FtpClient(Host, UserName, Password);
2727

28+
if (DebugMode)
29+
ftpClient.OnLogEvent += (level, s) => Console.WriteLine($"{level}: {s}");
30+
2831
try
2932
{
3033
if (EnableSsl)

Ftp.Client.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<PropertyGroup>
33
<OutputType>Exe</OutputType>
44
<TargetFramework>net6.0</TargetFramework>
5-
<AssemblyVersion>1.0.2</AssemblyVersion>
6-
<FileVersion>1.0.2</FileVersion>
7-
<version>1.0.2</version>
5+
<AssemblyVersion>1.0.3</AssemblyVersion>
6+
<FileVersion>1.0.3</FileVersion>
7+
<version>1.0.3</version>
88
</PropertyGroup>
99
<ItemGroup>
1010
<PackageReference Include="CommandLineParser" Version="2.8.0" />

FtpCommand.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ public string Certificate
5757
set;
5858
}
5959

60+
[Option('d', "debug", Required = false, HelpText = "Enables detailed logging.")]
61+
public bool DebugMode
62+
{
63+
get;
64+
set;
65+
}
66+
6067
public virtual void Execute()
6168
{
6269

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ Currently there is two ftp commands available in the tool.
2727
-e, --external-ip Set this parameter to your NAT outgoing IP if you are operating within a NAT
2828

2929
-r, --certificate Certificate string. If this parameter has been set then the validation will occur.
30+
31+
-d, --debug Enables detailed logging.
3032

3133
--help Display this help screen.
3234

@@ -50,6 +52,8 @@ Currently there is two ftp commands available in the tool.
5052

5153
-r, --certificate Certificate string. If this parameter has been set then the validation will occur.
5254

55+
-d, --debug Enables detailed logging.
56+
5357
--help Display this help screen.
5458

5559
--version Display version information.
@@ -63,7 +67,7 @@ In order to call simple ftp commands within this application (using dotnet) to t
6367

6468
## Download
6569

66-
You can download the latest version [here](https://github.com/faridprogrammer/ftp.client/releases/tag/V1.0.1).
70+
You can download the latest version [here](https://github.com/faridprogrammer/ftp.client/releases/tag/v1.0.3).
6771

6872

6973

0 commit comments

Comments
 (0)