diff options
author | Wouter Tinus <win.acme.simple@gmail.com> | 2019-12-14 09:02:22 +0100 |
---|---|---|
committer | Wouter Tinus <win.acme.simple@gmail.com> | 2019-12-14 09:02:22 +0100 |
commit | 598a42efffcd11b308bfc7cb2a15e021a99e442d (patch) | |
tree | 8b7afedd3d662fac603a8b7c22791b67b6372b28 /src/main.lib/Services/InputService.cs | |
parent | f084f256ed0fda699acdb86c51f95b1e5478c34f (diff) | |
download | letsencrypt-win-simple-598a42efffcd11b308bfc7cb2a15e021a99e442d.zip letsencrypt-win-simple-598a42efffcd11b308bfc7cb2a15e021a99e442d.tar.gz letsencrypt-win-simple-598a42efffcd11b308bfc7cb2a15e021a99e442d.tar.bz2 |
null annotations progress
Diffstat (limited to 'src/main.lib/Services/InputService.cs')
-rw-r--r-- | src/main.lib/Services/InputService.cs | 14 |
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); |