Add a `--services` option to the `tail` command
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.