Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): Add support for --as to list command #2228

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/cli/src/commands/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
import os from 'os';
import { E } from '@endo/far';
import { makeRefIterator } from '@endo/daemon';
import { withEndoHost } from '../context.js';
import { withEndoAgent } from '../context.js';

export const list = async ({ directoryPath, follow, json }) =>
withEndoHost({ os, process }, async ({ host: agent }) => {
export const list = async ({ directoryPath, follow, json, agentNames }) =>
withEndoAgent(agentNames, { os, process }, async ({ agent }) => {
if (directoryPath !== undefined) {
agent = E(agent).lookup(...directoryPath.split('.'));
}
Expand Down
5 changes: 3 additions & 2 deletions packages/cli/src/endo.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,12 +278,13 @@ export const main = async rawArgs => {
program
.command('list [directory]')
.description('show names known to the current or specified directory')
.option(...commonOptions.as)
.option('-f,--follow', 'Follow updates')
.option('-j,--json', 'JSON format output')
.action(async (directoryPath, cmd) => {
const { follow, json } = cmd.opts();
const { as: agentNames, follow, json } = cmd.opts();
const { list } = await import('./commands/list.js');
return list({ directoryPath, follow, json });
return list({ directoryPath, follow, json, agentNames });
});

program
Expand Down
Loading