Skip to content

status: keep the tolerated read error out of the format switch - #1

Open
Hojun-Cho wants to merge 1 commit into
npmania:masterfrom
Hojun-Cho:status-plain
Open

status: keep the tolerated read error out of the format switch #1
Hojun-Cho wants to merge 1 commit into
npmania:masterfrom
Hojun-Cho:status-plain

Conversation

@Hojun-Cho

Copy link
Copy Markdown

before:

$ mvad status
mvad: status: interface not present
$ echo $?
2

after:

$ mvad status
disconnected
account expires in 26 days
device: happy-bear
$ echo $?
1

status.Read's ErrNotConnected is tolerated but left in err. json and waybar
overwrite err with their own result, plain doesn't, so the check after the
switch returns before fmt.Print. Broken since 946e72e. json and waybar
output is unchanged.

One err held both ErrNotConnected and the formatting result, so the
plain branch, which sets neither, returned exit 2 before fmt.Print and
printed nothing at all when down.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant