Skip to content

Fix ls command to properly list services by name #53

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anak10thn
Copy link
Member

This PR fixes Issue #9: [CMD] list all and specific service

Problem

The orcinus ls [service name] command was incorrectly calling ps.prs() which shows service tasks/processes instead of service status. This didn't match the expected behavior described in the issue.

Solution

  1. Fixed CLI routing: Changed cli.js line 122 from ps.prs(program.ls) to list.prs(program.ls) to properly route service name filtering to the list module.

  2. Improved service filtering: Updated list.js to use docker service ls -f 'name=<name>' directly instead of piping through grep, which matches the behavior shown in the issue comment.

  3. Added tests: Created unit tests to verify the correct docker commands are generated for both specific service filtering and listing all services.

Changes Made

  • cli.js: Fixed routing for service name filtering
  • lib/list.js: Simplified service filtering command
  • test/test-list.js: Added unit tests for list functionality

Testing

  • All existing functionality preserved
  • New unit tests pass
  • Commands execute without syntax errors

Fixes #9

- Fixed cli.js to call list.prs() instead of ps.prs() for service name filtering
- Improved list.js to use docker service ls -f name=<name> without grep
- Added unit tests to verify the correct docker commands are generated
- Resolves issue #9: [CMD] list all and specific service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CMD] list all and specific service
2 participants