Improve output of a status command (#312)

This commit is contained in:
Misha Bragin 2022-05-12 21:57:31 +02:00 committed by GitHub
parent e5c52efb4c
commit b623c255b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,12 +38,14 @@ var statusCmd = &cobra.Command{
return fmt.Errorf("status failed: %v", status.Convert(err).Message())
}
cmd.Printf("Status: %s\n\n", resp.GetStatus())
if resp.GetStatus() == string(internal.StatusNeedsLogin) || resp.GetStatus() == string(internal.StatusLoginFailed) {
// todo: update login doc url
cmd.Printf("run the command \"netbird up\" to login. If no SSO provider has been set " +
"in your management server" +
"you can use a setup-key, " +
"see more at https://www.netbird.io/docs/overview/setup-keys for more info")
cmd.Printf("Run UP command to log in with SSO (interactive login):\n\n" +
" netbird up \n\n" +
"If you are running a self-hosted version and no SSO provider has been configured in your Management Server,\n" +
"you can use a setup-key:\n\n netbird up --management-url <YOUR_MANAGEMENT_URL> --setup-key <YOUR_SETUP_KEY>\n\n" +
"More info: https://www.netbird.io/docs/overview/setup-keys\n\n")
}
return nil