hotdog icon indicating copy to clipboard operation
hotdog copied to clipboard

ssh and pssh prefer primary_tag as hostname

Open frsyuki opened this issue 5 years ago • 2 comments

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.

frsyuki avatar Aug 01 '19 18:08 frsyuki

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

yyuu avatar Aug 01 '19 21:08 yyuu

yes. please use this PR in anyways as you would like.

frsyuki avatar Aug 02 '19 05:08 frsyuki