MCPcopy Create free account
hub / github.com/dropbox/dbxcli / TestExecuteExitHelper

Function TestExecuteExitHelper

cmd/root_test.go:206–227  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

204}
205
206func TestExecuteExitHelper(t *testing.T) {
207 if os.Getenv("DBXCLI_TEST_EXECUTE_HELPER") != "1" {
208 return
209 }
210
211 separator := -1
212 for i, arg := range os.Args {
213 if arg == "--" {
214 separator = i
215 break
216 }
217 }
218 if separator < 0 {
219 os.Exit(exitCodeGenericError)
220 }
221
222 args := append([]string(nil), os.Args[separator+1:]...)
223 os.Args = append([]string{"dbxcli"}, args...)
224 RootCmd.SetArgs(args)
225 Execute()
226 os.Exit(exitCodeSuccess)
227}
228
229func newAuthTestCommand() *cobra.Command {
230 root := &cobra.Command{Use: "dbxcli"}

Callers

nothing calls this directly

Calls 1

ExecuteFunction · 0.85

Tested by

no test coverage detected