@@ -36,9 +36,9 @@ public static void Main(string[] args)
36
36
37
37
if ( StringComparer . OrdinalIgnoreCase . Equals ( args [ 0 ] , "prompt" ) )
38
38
{
39
- string enterpriseUrl = GetParameter ( args , "--enterprise-url" ) ;
40
- bool basic = TryGetSwitch ( args , "--basic" ) ;
41
- bool oauth = TryGetSwitch ( args , "--oauth" ) ;
39
+ string enterpriseUrl = CommandLineUtils . GetParameter ( args , "--enterprise-url" ) ;
40
+ bool basic = CommandLineUtils . TryGetSwitch ( args , "--basic" ) ;
41
+ bool oauth = CommandLineUtils . TryGetSwitch ( args , "--oauth" ) ;
42
42
43
43
if ( ! basic && ! oauth )
44
44
{
@@ -71,7 +71,7 @@ public static void Main(string[] args)
71
71
}
72
72
else if ( StringComparer . OrdinalIgnoreCase . Equals ( args [ 0 ] , "2fa" ) )
73
73
{
74
- bool isSms = TryGetSwitch ( args , "--sms" ) ;
74
+ bool isSms = CommandLineUtils . TryGetSwitch ( args , "--sms" ) ;
75
75
76
76
if ( ! prompts . ShowAuthenticationCodePrompt ( isSms , out string authCode ) )
77
77
{
@@ -111,22 +111,5 @@ private static bool TryGetParentWindowHandle(out IntPtr hwnd)
111
111
hwnd = default ( IntPtr ) ;
112
112
return false ;
113
113
}
114
-
115
- private static bool TryGetSwitch ( string [ ] args , string name )
116
- {
117
- return args . Any ( arg => StringComparer . OrdinalIgnoreCase . Equals ( arg , name ) ) ;
118
- }
119
-
120
- private static string GetParameter ( string [ ] args , string name )
121
- {
122
- int index = Array . FindIndex ( args , x => StringComparer . OrdinalIgnoreCase . Equals ( x , name ) ) ;
123
-
124
- if ( - 1 < index && index + 1 < args . Length )
125
- {
126
- return args [ index + 1 ] ;
127
- }
128
-
129
- return null ;
130
- }
131
114
}
132
115
}
0 commit comments