Skip to content

Commit 94129b8

Browse files
authored
Diagnostics (#58)
1 parent 54cd504 commit 94129b8

9 files changed

Lines changed: 2005 additions & 24 deletions

File tree

tdl/main.go

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ var app = &cli.App{
151151
Usage: fmt.Sprintf("commands for %s commands", internal.WebsiteAddress),
152152
Before: func(c *cli.Context) error {
153153
sub := c.Args().First()
154-
if sub == "init" || sub == "configure" {
154+
if sub == "init" || sub == "configure" || sub == "diagnostics" || sub == "diag" {
155155
return nil
156156
}
157157
return newHandlers(c).CheckServerConnection(c.Context, "", "", false)
@@ -368,6 +368,24 @@ Note: after completing this exercise, the next exercise will be the last one you
368368
return newHandlers(c).Skip(c.Context)
369369
},
370370
},
371+
{
372+
Name: "diagnostics",
373+
Aliases: []string{"diag"},
374+
Usage: "Run connectivity diagnostics for the verification server",
375+
Flags: configureFlags,
376+
// Bypass the parent training command's CheckServerConnection so
377+
// diagnostics still runs when the connection is broken — the
378+
// whole point of this command.
379+
Before: func(c *cli.Context) error { return nil },
380+
Action: func(c *cli.Context) error {
381+
return newHandlers(c).Diagnostics(
382+
c.Context,
383+
c.String("server"),
384+
c.String("region"),
385+
c.Bool("insecure"),
386+
)
387+
},
388+
},
371389
{
372390
Name: "settings",
373391
Usage: "View and change training settings",

0 commit comments

Comments
 (0)