Skip to content

Commit

Permalink
Consistently name SftpClientOptions 'options'. (#179)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmds authored Jun 8, 2024
1 parent 8bd467b commit 07165da
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ namespace Tmds.Ssh;
class SshClient : IDisposable
{
SshClient(string destination);
SshClient(SshClientSettings clientSettings);
SshClient(SshClientSettings settings);

// Calling ConnectAsync is optional when SshClientSettings.AutoConnect is set (default).
Task ConnectAsync(CancellationToken cancellationToken);
Expand Down Expand Up @@ -102,11 +102,11 @@ class SftpClient : IDisposable
const UnixFilePermissions DefaultCreateFilePermissions; // = '-rwxrwxrwx'.
// The SftpClient owns the connection.
SftpClient(string destination, SftpClientOptions? settings = null);
SftpClient(SshClientSettings sshSettings, SftpClientOptions? sftpSettings = null);
SftpClient(string destination, SftpClientOptions? options = null);
SftpClient(SshClientSettings settings, SftpClientOptions? options = null);

// The SshClient owns the connection.
SftpClient(SshClient client, SftpClientOptions? settings = null);
SftpClient(SshClient client, SftpClientOptions? options = null);

// Only usable when the SftpClient was constructed directly using the constructor that accepts a destination/SshClientSettings.
Task ConnectAsync(CancellationToken cancellationToken = default);
Expand Down
8 changes: 4 additions & 4 deletions src/Tmds.Ssh/SshClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ enum State
// For testing.
internal bool IsDisposed => _state == State.Disposed;

public SshClient(SshClientSettings clientSettings)
public SshClient(SshClientSettings settings)
{
_clientSettings = clientSettings ?? throw new ArgumentNullException(nameof(clientSettings));
_clientSettings = settings ?? throw new ArgumentNullException(nameof(settings));
}

public SshClient(string destination)
Expand Down Expand Up @@ -201,9 +201,9 @@ public async Task<SshDataStream> OpenUnixConnectionAsync(string path, Cancellati
public Task<SftpClient> OpenSftpClientAsync(CancellationToken cancellationToken)
=> OpenSftpClientAsync(null, cancellationToken);

public async Task<SftpClient> OpenSftpClientAsync(SftpClientOptions? settings = null, CancellationToken cancellationToken = default)
public async Task<SftpClient> OpenSftpClientAsync(SftpClientOptions? options = null, CancellationToken cancellationToken = default)
{
SftpClient sftpClient = new SftpClient(this, settings);
SftpClient sftpClient = new SftpClient(this, options);
try
{
await sftpClient.OpenAsync(cancellationToken).ConfigureAwait(false);
Expand Down
4 changes: 2 additions & 2 deletions src/Tmds.Ssh/SshSession.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ sealed partial class SshSession : ISshClientImplementation

public SshConnectionInfo ConnectionInfo { get; }

internal SshSession(SshClientSettings clientSettings, SshClient client)
internal SshSession(SshClientSettings settings, SshClient client)
{
_abortCts = new CancellationTokenSource();

_settings = clientSettings;
_settings = settings;

ConnectionInfo = new SshConnectionInfo()
{
Expand Down
6 changes: 3 additions & 3 deletions test/Tmds.Ssh.Tests/TestServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ public async Task<SshClient> CreateClientAsync(Action<SshClientSettings>? config
{
IPEndPoint ipEndPoint = (_serverSocket.LocalEndPoint as IPEndPoint)!;

var clientSettings = new SshClientSettings($"user@{ipEndPoint.Address}:{ipEndPoint.Port}");
var settings = new SshClientSettings($"user@{ipEndPoint.Address}:{ipEndPoint.Port}");

configure?.Invoke(clientSettings);
configure?.Invoke(settings);

var client = new SshClient(clientSettings);
var client = new SshClient(settings);

await client.ConnectAsync();

Expand Down

0 comments on commit 07165da

Please sign in to comment.