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

Add a --services option to the tail command #33

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

squatto
Copy link
Contributor

@squatto squatto commented Oct 25, 2023

I felt that it would be helpful to be able to specify one or more services to tail, rather than having to either do all or go through an interactive choice. This PR adds a --services option that lets you specify one or more service indexes and/or names to be tailed.

The relevant section of the readme shows how this works:


Tail one or more services

You can specify one or more services that you would like to tail by passing
the --services option with a comma-separated list of service indexes or service names.

You can find the index and name of each available service by running porter tail with no arguments:

~/Developer/anystack: $ porter tail

 Which service do you want to tail?:
  [0] anystack-octane
  [1] anystack-queue
  [2] anystack-vite

The following examples reference the service names and indexes found above:

~/Developer/anystack: $ porter tail --services=0,2
~/Developer/anystack: $ porter tail --services=anystack-octane,anystack-vite

The above two commands are functionally equivalent.

~/Developer/anystack: $ porter tail --services=1
~/Developer/anystack: $ porter tail --services=anystack-queue

The above two commands are functionally equivalent.


I didn't mention it in the readme, but you can mix indexes and names and they'll resolve correctly. For example, --services=anystack-octane,1,anystack-vite will resolve 1 to the anystack-queue service.

As part of this change, the list of services that are being tailed is output before tailing. This happens regardless of the options provided.

$ tail

 Which service do you want to tail?:
  [0] clientplatform-horizon
  [1] clientplatform-sync-tunnels
  [2] clientplatform-watch-horizon
  [3] clientplatform-yarn-watch
 > 0,1

Tailing services:
+-----------------------------+
| clientplatform-horizon      |
| clientplatform-sync-tunnels |
+-----------------------------+
Use CTRL+C to stop tailing.

@squatto squatto changed the title Add a --services option to the tail command Add a --services option to the tail command Oct 25, 2023
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.

None yet

1 participant