@@ -17,7 +17,7 @@ internal static class CliRuntime
1717 private static readonly string [ ] ApiKeyEnvironmentVariables = [ @"MODERNMT_API_KEY" ] ;
1818 private const string CredentialFileDirectoryName = ".modern-mt" ;
1919
20- public static async Task < global ::ModernMT . ModernMTClient > CreateClientAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
20+ public static async global :: System . Threading . Tasks . Task < global ::ModernMT . ModernMTClient > CreateClientAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
2121 {
2222 var apiKey = await TryResolveApiKeyAsync ( parseResult , cancellationToken ) . ConfigureAwait ( false ) ;
2323 var authorizations = string . IsNullOrWhiteSpace ( apiKey )
@@ -46,7 +46,7 @@ internal static class CliRuntime
4646 "Design" ,
4747 "CA1031:Do not catch general exception types" ,
4848 Justification = "Generated CLI commands map unexpected failures to a stable exit code." ) ]
49- public static async Task < int > RunAsync ( Func < Task > action , CancellationToken cancellationToken = default )
49+ public static async global :: System . Threading . Tasks . Task < int > RunAsync ( Func < global :: System . Threading . Tasks . Task > action , CancellationToken cancellationToken = default )
5050 {
5151 try
5252 {
@@ -75,13 +75,13 @@ public static async Task<int> RunAsync(Func<Task> action, CancellationToken canc
7575 }
7676 }
7777
78- public static async Task < string ? > TryResolveApiKeyAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
78+ public static async global :: System . Threading . Tasks . Task < string ? > TryResolveApiKeyAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
7979 {
8080 var probe = await ProbeAuthAsync ( parseResult , cancellationToken ) . ConfigureAwait ( false ) ;
8181 return probe . Active ? . RawValue ;
8282 }
8383
84- public static async Task < AuthStatusInfo > GetAuthStatusAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
84+ public static async global :: System . Threading . Tasks . Task < AuthStatusInfo > GetAuthStatusAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
8585 {
8686 var probe = await ProbeAuthAsync ( parseResult , cancellationToken ) . ConfigureAwait ( false ) ;
8787 return new AuthStatusInfo (
@@ -98,7 +98,7 @@ public static async Task<AuthStatusInfo> GetAuthStatusAsync(ParseResult parseRes
9898 . ToArray ( ) ) ;
9999 }
100100
101- public static async Task WriteUserSecretAsync ( string name , string value , CancellationToken cancellationToken = default )
101+ public static async global :: System . Threading . Tasks . Task WriteUserSecretAsync ( string name , string value , CancellationToken cancellationToken = default )
102102 {
103103 var path = GetUserSecretsPath ( ) ;
104104 var directory = Path . GetDirectoryName ( path ) ;
@@ -113,7 +113,7 @@ public static async Task WriteUserSecretAsync(string name, string value, Cancell
113113 await File . WriteAllTextAsync ( path , json , cancellationToken ) . ConfigureAwait ( false ) ;
114114 }
115115
116- public static async Task ClearUserSecretAsync ( string name , CancellationToken cancellationToken = default )
116+ public static async global :: System . Threading . Tasks . Task ClearUserSecretAsync ( string name , CancellationToken cancellationToken = default )
117117 {
118118 var path = GetUserSecretsPath ( ) ;
119119 if ( ! File . Exists ( path ) )
@@ -241,7 +241,7 @@ public static TimeSpan ParseDuration(string value, string optionName)
241241
242242
243243
244- public static async Task < string ? > ReadInputAsync (
244+ public static async global :: System . Threading . Tasks . Task < string ? > ReadInputAsync (
245245 ParseResult parseResult ,
246246 Option < string ? > inputOption ,
247247 Option < string ? > requestJsonOption ,
@@ -284,7 +284,7 @@ public static TimeSpan ParseDuration(string value, string optionName)
284284 return await ReadFlexibleInputAsync ( parseResult . GetValue ( inputOption ) ! , cancellationToken ) . ConfigureAwait ( false ) ;
285285 }
286286
287- public static async Task < T > ReadRequestAsync < T > (
287+ public static async global :: System . Threading . Tasks . Task < T > ReadRequestAsync < T > (
288288 ParseResult parseResult ,
289289 Option < string ? > inputOption ,
290290 Option < string ? > requestJsonOption ,
@@ -306,7 +306,7 @@ public static async Task<T> ReadRequestAsync<T>(
306306 : throw new CliException ( $ "Unable to deserialize request JSON as { typeof ( T ) . Name } .") ;
307307 }
308308
309- public static async Task < T ? > ReadRequestOrDefaultAsync < T > (
309+ public static async global :: System . Threading . Tasks . Task < T ? > ReadRequestOrDefaultAsync < T > (
310310 ParseResult parseResult ,
311311 Option < string ? > inputOption ,
312312 Option < string ? > requestJsonOption ,
@@ -367,19 +367,19 @@ public static string SerializeStringArray(IEnumerable<string> values)
367367 return JsonSerializer . Serialize ( values . ToArray ( ) ) ;
368368 }
369369
370- public static async Task WriteJsonAsync < T > ( ParseResult parseResult , T value , JsonSerializerContext context , CancellationToken cancellationToken = default )
370+ public static async global :: System . Threading . Tasks . Task WriteJsonAsync < T > ( ParseResult parseResult , T value , JsonSerializerContext context , CancellationToken cancellationToken = default )
371371 {
372372 var json = JsonSerializer . Serialize ( value , typeof ( T ) , context ) ;
373373 await WriteTextAsync ( parseResult , PrettyJson ( json ) , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
374374 }
375375
376- public static async Task WriteJsonLineAsync < T > ( ParseResult parseResult , T value , JsonSerializerContext context , CancellationToken cancellationToken = default )
376+ public static async global :: System . Threading . Tasks . Task WriteJsonLineAsync < T > ( ParseResult parseResult , T value , JsonSerializerContext context , CancellationToken cancellationToken = default )
377377 {
378378 var json = JsonSerializer . Serialize ( value , typeof ( T ) , context ) ;
379379 await WriteTextAsync ( parseResult , json + Environment . NewLine , append : true , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
380380 }
381381
382- public static async Task WriteResponseAsync < T > (
382+ public static async global :: System . Threading . Tasks . Task WriteResponseAsync < T > (
383383 ParseResult parseResult ,
384384 T value ,
385385 JsonSerializerContext context ,
@@ -399,7 +399,7 @@ public static async Task WriteResponseAsync<T>(
399399 await WriteTextAsync ( parseResult , text , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
400400 }
401401
402- public static async Task WriteResponseLineAsync < T > (
402+ public static async global :: System . Threading . Tasks . Task WriteResponseLineAsync < T > (
403403 ParseResult parseResult ,
404404 T value ,
405405 JsonSerializerContext context ,
@@ -419,7 +419,7 @@ public static async Task WriteResponseLineAsync<T>(
419419 await WriteTextAsync ( parseResult , text + Environment . NewLine , append : true , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
420420 }
421421
422- public static async Task < bool > TryWriteOutputDirectoryAsync < T > (
422+ public static async global :: System . Threading . Tasks . Task < bool > TryWriteOutputDirectoryAsync < T > (
423423 ParseResult parseResult ,
424424 T value ,
425425 JsonSerializerContext context ,
@@ -445,7 +445,7 @@ public static async Task<bool> TryWriteOutputDirectoryAsync<T>(
445445 return true ;
446446 }
447447
448- public static async Task WriteSuccessAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
448+ public static async global :: System . Threading . Tasks . Task WriteSuccessAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
449449 {
450450 if ( parseResult . GetValue ( CliOptions . Json ) )
451451 {
@@ -456,7 +456,7 @@ public static async Task WriteSuccessAsync(ParseResult parseResult, Cancellation
456456 await WriteTextAsync ( parseResult , "success: true" , cancellationToken : cancellationToken ) . ConfigureAwait ( false ) ;
457457 }
458458
459- public static async Task WriteBinaryAsync ( ParseResult parseResult , byte [ ] bytes , CancellationToken cancellationToken = default )
459+ public static async global :: System . Threading . Tasks . Task WriteBinaryAsync ( ParseResult parseResult , byte [ ] bytes , CancellationToken cancellationToken = default )
460460 {
461461 var outputPath = parseResult . GetValue ( CliOptions . Output ) ;
462462 if ( string . IsNullOrWhiteSpace ( outputPath ) )
@@ -467,7 +467,7 @@ public static async Task WriteBinaryAsync(ParseResult parseResult, byte[] bytes,
467467 await WriteBytesAsync ( outputPath , bytes , cancellationToken ) . ConfigureAwait ( false ) ;
468468 }
469469
470- public static async Task WriteStreamAsync ( ParseResult parseResult , Stream stream , CancellationToken cancellationToken = default )
470+ public static async global :: System . Threading . Tasks . Task WriteStreamAsync ( ParseResult parseResult , Stream stream , CancellationToken cancellationToken = default )
471471 {
472472 var outputPath = parseResult . GetValue ( CliOptions . Output ) ;
473473 if ( string . IsNullOrWhiteSpace ( outputPath ) )
@@ -504,13 +504,13 @@ public static string MaskSecret(string secret)
504504 return string . IsNullOrWhiteSpace ( baseUrl ) ? null : new Uri ( baseUrl , UriKind . Absolute ) ;
505505 }
506506
507- private static async Task < string ? > ReadUserSecretAsync ( string name , CancellationToken cancellationToken = default )
507+ private static async global :: System . Threading . Tasks . Task < string ? > ReadUserSecretAsync ( string name , CancellationToken cancellationToken = default )
508508 {
509509 var values = await ReadUserSecretsAsync ( cancellationToken ) . ConfigureAwait ( false ) ;
510510 return values . TryGetValue ( name , out var value ) && ! string . IsNullOrWhiteSpace ( value ) ? value : null ;
511511 }
512512
513- private static async Task < string ? > ReadCredentialFileAsync ( CancellationToken cancellationToken = default )
513+ private static async global :: System . Threading . Tasks . Task < string ? > ReadCredentialFileAsync ( CancellationToken cancellationToken = default )
514514 {
515515 var path = GetCredentialFilePath ( ) ;
516516 if ( string . IsNullOrWhiteSpace ( path ) || ! File . Exists ( path ) )
@@ -522,7 +522,7 @@ public static string MaskSecret(string secret)
522522 return string . IsNullOrWhiteSpace ( value ) ? null : value . Trim ( ) ;
523523 }
524524
525- private static async Task < Dictionary < string , string > > ReadUserSecretsAsync ( CancellationToken cancellationToken = default )
525+ private static async global :: System . Threading . Tasks . Task < Dictionary < string , string > > ReadUserSecretsAsync ( CancellationToken cancellationToken = default )
526526 {
527527 var path = GetUserSecretsPath ( ) ;
528528 if ( ! File . Exists ( path ) )
@@ -540,7 +540,7 @@ private static async Task<Dictionary<string, string>> ReadUserSecretsAsync(Cance
540540 new Dictionary < string , string > ( StringComparer . Ordinal ) ;
541541 }
542542
543- private static async Task WriteTextAsync ( ParseResult parseResult , string text , bool append = false , CancellationToken cancellationToken = default )
543+ private static async global :: System . Threading . Tasks . Task WriteTextAsync ( ParseResult parseResult , string text , bool append = false , CancellationToken cancellationToken = default )
544544 {
545545 var outputPath = parseResult . GetValue ( CliOptions . Output ) ;
546546 if ( string . IsNullOrWhiteSpace ( outputPath ) )
@@ -570,7 +570,7 @@ private static async Task WriteTextAsync(ParseResult parseResult, string text, b
570570 }
571571 }
572572
573- private static async Task WriteBytesAsync ( string outputPath , byte [ ] bytes , CancellationToken cancellationToken = default )
573+ private static async global :: System . Threading . Tasks . Task WriteBytesAsync ( string outputPath , byte [ ] bytes , CancellationToken cancellationToken = default )
574574 {
575575 var directory = Path . GetDirectoryName ( outputPath ) ;
576576 if ( ! string . IsNullOrWhiteSpace ( directory ) )
@@ -586,12 +586,12 @@ private static bool EndsWithUnit(string value, char unit)
586586 return value . Length > 1 && value [ ^ 1 ] == unit ;
587587 }
588588
589- private static async Task WriteDeprecatedOptionWarningAsync ( string oldOption , string replacement )
589+ private static async global :: System . Threading . Tasks . Task WriteDeprecatedOptionWarningAsync ( string oldOption , string replacement )
590590 {
591591 await Console . Error . WriteLineAsync ( $ "Warning: { oldOption } is deprecated; use { replacement } .") . ConfigureAwait ( false ) ;
592592 }
593593
594- private static async Task < string > ReadFlexibleInputAsync ( string input , CancellationToken cancellationToken = default )
594+ private static async global :: System . Threading . Tasks . Task < string > ReadFlexibleInputAsync ( string input , CancellationToken cancellationToken = default )
595595 {
596596 if ( string . IsNullOrWhiteSpace ( input ) )
597597 {
@@ -612,7 +612,7 @@ private static async Task<string> ReadFlexibleInputAsync(string input, Cancellat
612612 return await ReadFileOrStdinAsync ( input , cancellationToken ) . ConfigureAwait ( false ) ;
613613 }
614614
615- private static async Task < string > ReadFileOrStdinAsync ( string pathOrDash , CancellationToken cancellationToken = default )
615+ private static async global :: System . Threading . Tasks . Task < string > ReadFileOrStdinAsync ( string pathOrDash , CancellationToken cancellationToken = default )
616616 {
617617 if ( pathOrDash == "-" )
618618 {
@@ -830,7 +830,7 @@ private static void AppendLine(StringBuilder builder, int indent, string value)
830830 builder . AppendLine ( value ) ;
831831 }
832832
833- private static async Task WriteItemFilesAsync ( string outputDirectory , JsonArray items , CancellationToken cancellationToken = default )
833+ private static async global :: System . Threading . Tasks . Task WriteItemFilesAsync ( string outputDirectory , JsonArray items , CancellationToken cancellationToken = default )
834834 {
835835 Directory . CreateDirectory ( outputDirectory ) ;
836836
@@ -880,7 +880,7 @@ await File.WriteAllTextAsync(
880880 }
881881 }
882882
883- private static async Task < bool > TryWriteTextPropertyAsync (
883+ private static async global :: System . Threading . Tasks . Task < bool > TryWriteTextPropertyAsync (
884884 JsonObject item ,
885885 string outputDirectory ,
886886 string baseName ,
@@ -946,7 +946,7 @@ private static string SanitizeFileName(string value)
946946 return normalized ;
947947 }
948948
949- private static async Task WriteApiExceptionAsync ( global ::ModernMT . ApiException exception )
949+ private static async global :: System . Threading . Tasks . Task WriteApiExceptionAsync ( global ::ModernMT . ApiException exception )
950950 {
951951 var builder = new StringBuilder ( ) ;
952952 builder . Append ( "API error " ) ;
@@ -974,7 +974,7 @@ private static string PrettyJson(string json)
974974 return Encoding . UTF8 . GetString ( stream . ToArray ( ) ) ;
975975 }
976976
977- private static async Task < AuthProbeResult > ProbeAuthAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
977+ private static async global :: System . Threading . Tasks . Task < AuthProbeResult > ProbeAuthAsync ( ParseResult parseResult , CancellationToken cancellationToken = default )
978978 {
979979 var optionSource = new AuthSourceProbe (
980980 Source : "option" ,
0 commit comments