Skip to content

Commit

Permalink
fix(rust): improve ockam space list output when there are no spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
k1nho authored and adrianbenavides committed Oct 4, 2023
1 parent 79b458c commit a24dfee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions implementations/rust/ockam/ockam_command/src/space/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ async fn run_impl(

let (spaces, _) = try_join!(get_spaces, progress_output)?;

let plain = opts
.terminal
.build_list(&spaces, "Spaces", "No spaces found.")?;
let plain = opts.terminal.build_list(
&spaces,
"Spaces",
"No spaces found. Run 'ockam enroll' to get a space and a project",
)?;
let json = serde_json::to_string_pretty(&spaces).into_diagnostic()?;

for space in spaces {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl<W: TerminalWriter> Terminal<W, ToStdErr> {

pub fn build_list(
&self,
items: &Vec<impl crate::output::Output>,
items: &[impl crate::output::Output],
header: &str,
empty_message: &str,
) -> Result<String> {
Expand Down

0 comments on commit a24dfee

Please sign in to comment.