hotdog
hotdog copied to clipboard
ssh and pssh prefer primary_tag as hostname
ssh and pssh commands were using the first element of search results but
it doesn't work well when tags
option is set at ~/.hotdog/config.yml
and the first element is not a hostname.
This change prefers to use primary_key instead of the first element if primary_key is set and primary_key is included in the tags option.
If tags option is not set or display_search_tags option is set, behavior doesn't change because primary_key exists as the first element.
I think, this kind of tag handling is better to be implemented within "get_hosts()" instead of individual commands impl 🤔
https://github.com/yyuu/hotdog/blob/v1.20190725.0/lib/hotdog/commands.rb#L104-L108
yes. please use this PR in anyways as you would like.