Skip to content

Commit

Permalink
imp - brk|doc - Made addon shells use the new feat...
Browse files Browse the repository at this point in the history
...ure

---

We've taken out the ShellBase property and replaced it with the generic
class definition.

---

Type: imp
Breaking: True
Doc Required: True
Backport Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Feb 2, 2025
1 parent 2126eda commit f41d07a
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 50 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,13 @@
namespace Nitrocid.Tests.Shell.ShellBase.Shells
{

class ShellInfoTest : BaseShellInfo, IShellInfo
class ShellInfoTest : BaseShellInfo<ShellTest>, IShellInfo
{

public override List<CommandInfo> Commands =>
[
new CommandInfo("test", "Test command", [
new CommandArgumentInfo()
], null)
];

public override BaseShell ShellBase => new ShellTest();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.ArchiveShell.Archive.Shell
/// <summary>
/// Common archive shell class
/// </summary>
internal class ArchiveShellInfo : BaseShellInfo, IShellInfo
internal class ArchiveShellInfo : BaseShellInfo<ArchiveShell>, IShellInfo
{

/// <summary>
/// Archive commands
/// </summary>
Expand Down Expand Up @@ -100,8 +99,5 @@ internal class ArchiveShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG2", new ArchivePowerLineBG2Preset() },
{ "PowerLineBG3", new ArchivePowerLineBG3Preset() }
};

public override BaseShell ShellBase => new ArchiveShell();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.FtpShell.FTP
/// <summary>
/// Common FTP shell class
/// </summary>
internal class FTPShellInfo : BaseShellInfo, IShellInfo
internal class FTPShellInfo : BaseShellInfo<FTPShell>, IShellInfo
{

/// <summary>
/// FTP commands
/// </summary>
Expand Down Expand Up @@ -257,11 +256,8 @@ internal class FTPShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG3", new FtpPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new FTPShell();

public override bool AcceptsNetworkConnection => true;

public override string NetworkConnectionType => "FTP";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.GitShell.Git
/// <summary>
/// Common Git shell class
/// </summary>
internal class GitShellInfo : BaseShellInfo, IShellInfo
internal class GitShellInfo : BaseShellInfo<GitShell>, IShellInfo
{

/// <summary>
/// Git commands
/// </summary>
Expand Down Expand Up @@ -231,8 +230,5 @@ internal class GitShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG2", new PowerLineBG2Preset() },
{ "PowerLineBG3", new PowerLineBG3Preset() }
};

public override BaseShell ShellBase => new GitShell();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ namespace Nitrocid.Extras.HttpShell.HTTP
/// <summary>
/// Common HTTP shell class
/// </summary>
internal class HTTPShellInfo : BaseShellInfo, IShellInfo
internal class HTTPShellInfo : BaseShellInfo<HTTPShell>, IShellInfo
{

/// <summary>
/// HTTP commands
/// </summary>
Expand Down Expand Up @@ -159,11 +158,8 @@ internal class HTTPShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG3", new HTTPPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new HTTPShell();

public override bool AcceptsNetworkConnection => true;

public override string NetworkConnectionType => "HTTP";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.JsonShell.Json
/// <summary>
/// Common JSON shell class
/// </summary>
internal class JsonShellInfo : BaseShellInfo, IShellInfo
internal class JsonShellInfo : BaseShellInfo<JsonShell>, IShellInfo
{

/// <summary>
/// JSON commands
/// </summary>
Expand Down Expand Up @@ -173,8 +172,5 @@ internal class JsonShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG2", new JsonPowerLineBG2Preset() },
{ "PowerLineBG3", new JsonPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new JsonShell();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ namespace Nitrocid.Extras.MailShell.Mail
/// <summary>
/// Common mail shell class
/// </summary>
internal class MailShellInfo : BaseShellInfo, IShellInfo
internal class MailShellInfo : BaseShellInfo<MailShell>, IShellInfo
{

/// <summary>
/// Mail commands
/// </summary>
Expand Down Expand Up @@ -181,11 +180,8 @@ internal class MailShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG3", new MailPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new MailShell();

public override bool AcceptsNetworkConnection => true;

public override string NetworkConnectionType => "Mail";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.RssShell.RSS
/// <summary>
/// Common RSS shell class
/// </summary>
internal class RSSShellInfo : BaseShellInfo, IShellInfo
internal class RSSShellInfo : BaseShellInfo<RSSShell>, IShellInfo
{

/// <summary>
/// RSS commands
/// </summary>
Expand Down Expand Up @@ -137,11 +136,8 @@ internal class RSSShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG3", new RSSPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new RSSShell();

public override bool AcceptsNetworkConnection => true;

public override string NetworkConnectionType => "RSS";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,8 @@ namespace Nitrocid.Extras.SftpShell.SFTP
/// <summary>
/// Common SFTP shell class
/// </summary>
internal class SFTPShellInfo : BaseShellInfo, IShellInfo
internal class SFTPShellInfo : BaseShellInfo<SFTPShell>, IShellInfo
{

/// <summary>
/// SFTP commands
/// </summary>
Expand Down Expand Up @@ -167,11 +166,8 @@ internal class SFTPShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG3", new SftpPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new SFTPShell();

public override bool AcceptsNetworkConnection => true;

public override string NetworkConnectionType => "SFTP";

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ namespace Nitrocid.Extras.SqlShell.Sql
/// <summary>
/// Common Sql shell class
/// </summary>
internal class SqlShellInfo : BaseShellInfo, IShellInfo
internal class SqlShellInfo : BaseShellInfo<SqlShell>, IShellInfo
{

/// <summary>
/// Sql commands
/// </summary>
Expand Down Expand Up @@ -64,8 +63,5 @@ internal class SqlShellInfo : BaseShellInfo, IShellInfo
{ "PowerLineBG2", new SqlPowerLineBG2Preset() },
{ "PowerLineBG3", new SqlPowerLineBG3Preset() }
};

public override BaseShell ShellBase => new SqlShell();

}
}

0 comments on commit f41d07a

Please sign in to comment.