mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
add paste function
This commit is contained in:
parent
b31d10d094
commit
b33365ed8e
3 changed files with 8 additions and 19 deletions
|
@ -38,26 +38,10 @@ pub struct StdinReader {
|
|||
}
|
||||
|
||||
impl StdinReader {
|
||||
#[cfg(all(target_os = "linux", feature = "full-repl"))]
|
||||
fn access_clipboard() -> Option<Output> {
|
||||
Command::new("inclip")
|
||||
.output()
|
||||
.ok()
|
||||
}
|
||||
#[cfg(all(target_os = "macos", feature = "full-repl"))]
|
||||
#[cfg(feature = "full-repl")]
|
||||
fn access_clipboard() -> Option<Output> {
|
||||
Some(
|
||||
Command::new("pbpast")
|
||||
.output()
|
||||
.expect("failed to get clipboard"),
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(all(target_os = "windows", feature = "full-repl"))]
|
||||
fn access_clipboard() -> Option<Output> {
|
||||
Some(
|
||||
Command::new("powershell")
|
||||
.args(["get-clipboard"])
|
||||
Command::new("inclip")
|
||||
.output()
|
||||
.expect("failed to get clipboard"),
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue