<table><tr><td style="">albertvaka added a comment.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D9059" rel="noreferrer">View Revision</a></tr></table><br /><div><div><p>I like what Android's ADB does: there is a command line argument that means "connect to the only device", but you have to manually specify it.</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">-d         use USB device (error if multiple devices connected)</pre></div>

<p>I would do this and make it work only if one device is *paired* (not connected, otherwise you might end up sending commands to the wrong device).</p>

<p>It could be something like <tt style="background: #ebebeb; font-size: 13px;">-s, --single-device       automatically connect to the only device paired (fails if paired to multiple devices)</tt>.</p>

<p>I like this approach better than doing it by default, and would happily accept the patch, otherwise I think it could be a 'footgun'. If we don't make it explicit and you don't know you have to specify the device, you might have some scripts that just work with one device paired, and then break when you pair a second device without understanding why.</p>

<p>What do you think?</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R224 KDE Connect</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D9059" rel="noreferrer">https://phabricator.kde.org/D9059</a></div></div><br /><div><strong>To: </strong>mtijink, KDE Connect<br /><strong>Cc: </strong>albertvaka, apol<br /></div>