Skip to content

Commit

Permalink
ls: Fix listing help formatting. (#136)
Browse files Browse the repository at this point in the history
I'd broken this in #42. Fix whitespace.

Before:

```
Showing the first 15 destinations (use `p0
       ls ssh session destination <like>` to narrow results). Resources labeled with * are already accessible to you:
```

After:

```
Showing the first 15 destinations (use `p0 ls ssh session destination <like>` to narrow results).
Resources labeled with * are already accessible to you:
```
  • Loading branch information
nbrahms authored Oct 31, 2024
1 parent c66b655 commit e8ac21a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/commands/__tests__/__snapshots__/ls.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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:",
],
]
`;
Expand Down
5 changes: 2 additions & 3 deletions src/commands/ls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,11 @@ const ls = async (
const postfixPart = data.term
? ` matching '${data.term}'`
: data.isTruncated
? ` (use \`p0
${allArguments.join(" ")} <like>\` to narrow results)`
? ` (use \`p0 ${allArguments.join(" ")} <like>\` 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);
Expand Down

0 comments on commit e8ac21a

Please sign in to comment.