summaryrefslogtreecommitdiffstats
path: root/src/main.lib/Services/InputService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.lib/Services/InputService.cs')
-rw-r--r--src/main.lib/Services/InputService.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/main.lib/Services/InputService.cs b/src/main.lib/Services/InputService.cs
index 7bd62cb..0845e23 100644
--- a/src/main.lib/Services/InputService.cs
+++ b/src/main.lib/Services/InputService.cs
@@ -82,7 +82,7 @@ namespace PKISharp.WACS.Services
return "";
}
- public void Show(string label, string value, bool newLine = false, int level = 0)
+ public void Show(string? label, string? value, bool newLine = false, int level = 0)
{
if (newLine)
{
@@ -228,7 +228,7 @@ namespace PKISharp.WACS.Services
// Replaces the characters of the typed in password with asterisks
// More info: http://rajeshbailwal.blogspot.com/2012/03/password-in-c-console-application.html
- public Task<string> ReadPassword(string what)
+ public async Task<string?> ReadPassword(string what)
{
Validate(what);
CreateSpace();
@@ -278,11 +278,11 @@ namespace PKISharp.WACS.Services
var ret = password.ToString();
if (string.IsNullOrEmpty(ret))
{
- return Task.FromResult<string>(null);
+ return null;
}
else
{
- return Task.FromResult(ret);
+ return ret;
}
}
@@ -290,7 +290,11 @@ namespace PKISharp.WACS.Services
/// Print a (paged) list of targets for the user to choose from
/// </summary>
/// <param name="targets"></param>
- public async Task<T> ChooseFromList<S, T>(string what, IEnumerable<S> options, Func<S, Choice<T>> creator, string nullLabel = null)
+ public async Task<T> ChooseFromList<S, T>(
+ string what,
+ IEnumerable<S> options,
+ Func<S, Choice<T>> creator,
+ string? nullLabel = null)
{
var baseChoices = options.Select(creator).ToList();
var allowNull = !string.IsNullOrEmpty(nullLabel);