File tree Expand file tree Collapse file tree 2 files changed +12
-4
lines changed
Expand file tree Collapse file tree 2 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -169,12 +169,14 @@ dyt --record
169169dyt --record --daemon http://192.168.1.10:3030
170170```
171171
172- Output goes to both clipboard and stdout, so you can pipe it:
172+ By default, output goes to both clipboard and stdout, so you can pipe it:
173173
174174``` bash
175175dyt --record | wc -w
176176```
177177
178+ Copying to the clipboard can be suppressed with the ` --no-clipboard ` option.
179+
178180### Smoke test
179181
180182Verify your mic works without needing the daemon:
Original file line number Diff line number Diff line change @@ -13,6 +13,10 @@ struct Cli {
1313 /// Daemon address
1414 #[ arg( long, default_value = "http://127.0.0.1:3030" ) ]
1515 daemon : String ,
16+
17+ /// Suppress copying text to the clipboard.
18+ #[ arg( long) ]
19+ no_clipboard : bool ,
1620}
1721
1822fn main ( ) -> Result < ( ) > {
@@ -33,9 +37,11 @@ fn main() -> Result<()> {
3337 let text = transport:: transcribe ( & cli. daemon , & wav_bytes) ?;
3438 eprintln ! ( "Transcribed: {text}" ) ;
3539
36- let mut clipboard = arboard:: Clipboard :: new ( ) ?;
37- clipboard. set_text ( & text) ?;
38- eprintln ! ( "Copied to clipboard." ) ;
40+ if !cli. no_clipboard {
41+ let mut clipboard = arboard:: Clipboard :: new ( ) ?;
42+ clipboard. set_text ( & text) ?;
43+ eprintln ! ( "Copied to clipboard." ) ;
44+ }
3945
4046 // Also print to stdout for piping
4147 print ! ( "{text}" ) ;
You can’t perform that action at this time.
0 commit comments