fix(cli): list-sessions stderr on fail (#1174)

Change `list-sessions` to report an error `1` on the shell
and put the output to stderr,
this can be valuable for scriping and should be consistent with expectations
This commit is contained in:
a-kenji 2022-03-04 17:55:16 +01:00 committed by GitHub
parent 147fd729dc
commit 6ad2d55a5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,8 +133,8 @@ pub(crate) fn list_sessions() {
0 0
} }
Ok(_) => { Ok(_) => {
println!("No active zellij sessions found."); eprintln!("No active zellij sessions found.");
0 1
} }
Err(e) => { Err(e) => {
eprintln!("Error occurred: {:?}", e); eprintln!("Error occurred: {:?}", e);