Skip to content

Enhancement: deprecation warning should be written to stderr instead of stdout #1552

@alexandair

Description

@alexandair

Description

Command 'accesstoken get' is deprecated, but it still works and outputs wrongly the warning message in stdout stream and invalidates the token.

Steps to reproduce

$ token=$(o365 accesstoken get --resource https://graph.microsoft.com)

$ echo $token
Command 'accesstoken get' is deprecated. Please use 'util accesstoken get' instead eyJ0eXAiOiJKV1QiLCJub25jZSI6ImVKSnlKTkFzNlI3N1libTJWaTFWVExoOXp1dFE1djA1YUxtc3JhcmVvLUkiLCJhbGciOiJSUzI1NiIsIng1dCI6IkN0VHVoTUpt...

Expected result

$ echo $token
eyJ0eXAiOiJKV1QiLCJub25jZSI6ImVKSnlKTkFzNlI3N1libTJWaTFWVExoOXp1dFE1djA1YUxtc3JhcmVvLUkiLCJhbGciOiJSUzI1NiIsIng1dCI6IkN0VHVoTUpt...

Actual result

$ echo $token
Command 'accesstoken get' is deprecated. Please use 'util accesstoken get' instead eyJ0eXAiOiJKV1QiLCJub25jZSI6ImVKSnlKTkFzNlI3N1libTJWaTFWVExoOXp1dFE1djA1YUxtc3JhcmVvLUkiLCJhbGciOiJSUzI1NiIsIng1dCI6IkN0VHVoTUpt...

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions