@@ -5,8 +5,8 @@ import { it, expect, describe, vi } from "vitest";
55import {
66 type CliAuth ,
77 getGlobalFlags ,
8- getGlobalFlagsForExec ,
98 getGlobalFlagsRaw ,
9+ getGlobalShellFlags ,
1010 getSshFlags ,
1111 isKeyringEnabled ,
1212 resolveCliAuth ,
@@ -24,7 +24,7 @@ const globalConfigAuth: CliAuth = {
2424} ;
2525
2626describe ( "cliConfig" , ( ) => {
27- describe ( "getGlobalFlags " , ( ) => {
27+ describe ( "getGlobalShellFlags " , ( ) => {
2828 const urlAuth : CliAuth = { mode : "url" , url : "https://dev.coder.com" } ;
2929
3030 interface AuthFlagsCase {
@@ -48,7 +48,9 @@ describe("cliConfig", () => {
4848 "should return auth flags for $scenario" ,
4949 ( { auth, expectedAuthFlags } ) => {
5050 const config = new MockConfigurationProvider ( ) ;
51- expect ( getGlobalFlags ( config , auth ) ) . toStrictEqual ( expectedAuthFlags ) ;
51+ expect ( getGlobalShellFlags ( config , auth ) ) . toStrictEqual (
52+ expectedAuthFlags ,
53+ ) ;
5254 } ,
5355 ) ;
5456
@@ -59,7 +61,7 @@ describe("cliConfig", () => {
5961 "--disable-direct-connections" ,
6062 ] ) ;
6163
62- expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
64+ expect ( getGlobalShellFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
6365 "--verbose" ,
6466 "--disable-direct-connections" ,
6567 "--global-config" ,
@@ -77,7 +79,7 @@ describe("cliConfig", () => {
7779 "--disable-direct-connections" ,
7880 ] ) ;
7981
80- expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
82+ expect ( getGlobalShellFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
8183 "--verbose" ,
8284 "--disable-direct-connections" ,
8385 "--global-config" ,
@@ -113,12 +115,12 @@ describe("cliConfig", () => {
113115 const config = new MockConfigurationProvider ( ) ;
114116 config . set ( "coder.globalFlags" , flags ) ;
115117
116- expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
118+ expect ( getGlobalShellFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
117119 "-v" ,
118120 "--global-config" ,
119121 '"/config/dir"' ,
120122 ] ) ;
121- expect ( getGlobalFlags ( config , urlAuth ) ) . toStrictEqual ( [
123+ expect ( getGlobalShellFlags ( config , urlAuth ) ) . toStrictEqual ( [
122124 "-v" ,
123125 "--url" ,
124126 '"https://dev.coder.com"' ,
@@ -130,7 +132,7 @@ describe("cliConfig", () => {
130132 const config = new MockConfigurationProvider ( ) ;
131133 config . set ( "coder.globalFlags" , [ "--global-configs" , "--use-keyrings" ] ) ;
132134
133- expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
135+ expect ( getGlobalShellFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
134136 "--global-configs" ,
135137 "--use-keyrings" ,
136138 "--global-config" ,
@@ -161,7 +163,7 @@ describe("cliConfig", () => {
161163 "--no-feature-warning" ,
162164 ] ) ;
163165
164- expect ( getGlobalFlags ( config , auth ) ) . toStrictEqual ( [
166+ expect ( getGlobalShellFlags ( config , auth ) ) . toStrictEqual ( [
165167 "-v" ,
166168 "--header-command custom" , // ignored by CLI
167169 "--no-feature-warning" ,
@@ -173,16 +175,16 @@ describe("cliConfig", () => {
173175 ) ;
174176 } ) ;
175177
176- describe ( "getGlobalFlagsForExec " , ( ) => {
178+ describe ( "getGlobalFlags " , ( ) => {
177179 const urlAuth : CliAuth = { mode : "url" , url : "https://dev.coder.com" } ;
178180
179181 it ( "should not escape auth flags" , ( ) => {
180182 const config = new MockConfigurationProvider ( ) ;
181- expect ( getGlobalFlagsForExec ( config , globalConfigAuth ) ) . toStrictEqual ( [
183+ expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
182184 "--global-config" ,
183185 "/config/dir" ,
184186 ] ) ;
185- expect ( getGlobalFlagsForExec ( config , urlAuth ) ) . toStrictEqual ( [
187+ expect ( getGlobalFlags ( config , urlAuth ) ) . toStrictEqual ( [
186188 "--url" ,
187189 "https://dev.coder.com" ,
188190 ] ) ;
@@ -191,7 +193,7 @@ describe("cliConfig", () => {
191193 it ( "should still escape header-command flags" , ( ) => {
192194 const config = new MockConfigurationProvider ( ) ;
193195 config . set ( "coder.headerCommand" , "echo test" ) ;
194- expect ( getGlobalFlagsForExec ( config , globalConfigAuth ) ) . toStrictEqual ( [
196+ expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
195197 "--global-config" ,
196198 "/config/dir" ,
197199 "--header-command" ,
@@ -202,7 +204,7 @@ describe("cliConfig", () => {
202204 it ( "should include user global flags" , ( ) => {
203205 const config = new MockConfigurationProvider ( ) ;
204206 config . set ( "coder.globalFlags" , [ "--verbose" ] ) ;
205- expect ( getGlobalFlagsForExec ( config , globalConfigAuth ) ) . toStrictEqual ( [
207+ expect ( getGlobalFlags ( config , globalConfigAuth ) ) . toStrictEqual ( [
206208 "--verbose" ,
207209 "--global-config" ,
208210 "/config/dir" ,
0 commit comments