Add a --services
option to the tail
command
#33
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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: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 resolve1
to theanystack-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.