From e8ac21ae9ccce3fc0e9fc939e8cb66522bc504e0 Mon Sep 17 00:00:00 2001 From: Nathan Brahms Date: Thu, 31 Oct 2024 11:24:33 -0700 Subject: [PATCH] ls: Fix listing help formatting. (#136) I'd broken this in #42. Fix whitespace. Before: ``` Showing the first 15 destinations (use `p0 ls ssh session destination ` to narrow results). Resources labeled with * are already accessible to you: ``` After: ``` Showing the first 15 destinations (use `p0 ls ssh session destination ` to narrow results). Resources labeled with * are already accessible to you: ``` --- src/commands/__tests__/__snapshots__/ls.test.ts.snap | 3 ++- src/commands/ls.ts | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/commands/__tests__/__snapshots__/ls.test.ts.snap b/src/commands/__tests__/__snapshots__/ls.test.ts.snap index 7437f60..944c0c4 100644 --- a/src/commands/__tests__/__snapshots__/ls.test.ts.snap +++ b/src/commands/__tests__/__snapshots__/ls.test.ts.snap @@ -29,7 +29,8 @@ exports[`ls when valid ls command should print friendly message if no items: std exports[`ls when valid ls command should print list response: stderr 1`] = ` [ [ - "Showing destinations. Resources labeled with * are already accessible to you:", + "Showing destinations. +Resources labeled with * are already accessible to you:", ], ] `; diff --git a/src/commands/ls.ts b/src/commands/ls.ts index 42da519..4d48155 100644 --- a/src/commands/ls.ts +++ b/src/commands/ls.ts @@ -72,12 +72,11 @@ const ls = async ( const postfixPart = data.term ? ` matching '${data.term}'` : data.isTruncated - ? ` (use \`p0 - ${allArguments.join(" ")} \` to narrow results)` + ? ` (use \`p0 ${allArguments.join(" ")} \` to narrow results)` : ""; print2( - `Showing${truncationPart} ${label}${postfixPart}. Resources labeled with * are already accessible to you:` + `Showing${truncationPart} ${label}${postfixPart}.\nResources labeled with * are already accessible to you:` ); const sortedItems = orderBy(data.items, "isPreexisting", "desc"); const isSameValue = sortedItems.every((i) => !i.group && i.key === i.value);