nakabonne / pbgopy

Copy and paste between devices
MIT License
807 stars 30 forks source link

'copy' and 'paste' commands can be figured out automatically #30

Closed kbd closed 3 years ago

kbd commented 3 years ago

Hi, just wanted to share this trick I use for regular pbcopy and pbpaste that lets me do both with one command.

My cb ("clipboard") program can be used everywhere pbcopy and pbpaste can and it figures out the right thing to do based on how it's used:

https://github.com/kbd/setup/blob/master/HOME/bin/cb

nakabonne commented 3 years ago

@kbd Hey, thank you for sharing your cool script! I was looking into automating that, while I decided to do not that to clearly distinguish the flags for sub-commands.

kbd commented 3 years ago

Great, makes sense, just wanted to share since not everyone knows about inspecting "isatty". Thanks!