11use clap:: { App , Arg } ;
2+ use clipboard:: { ClipboardContext , ClipboardProvider } ;
23use rand:: seq:: SliceRandom ;
34use regex:: Regex ;
45use rodio:: { OutputStream , Sink , Source } ;
56use std:: collections:: HashMap ;
67use std:: env;
7- use clipboard:: { ClipboardContext , ClipboardProvider } ;
88use std:: fs:: { self , File } ;
99use std:: io:: { self , Error , Read , Write } ;
1010use std:: path:: Path ;
@@ -17,7 +17,7 @@ mod test;
1717
1818fn main ( ) {
1919 let matches = App :: new ( "Stack" )
20- . version ( "1.11 " )
20+ . version ( "1.12 " )
2121 . author ( "Stack Programming Community" )
2222 . about ( "The powerful script language designed with a stack oriented approach for efficient execution. " )
2323 . arg ( Arg :: new ( "script" )
@@ -1406,14 +1406,14 @@ impl Executor {
14061406 ctx = i
14071407 } else {
14081408 self . stack . push ( Type :: Error ( "set-clipboard" . to_string ( ) ) ) ;
1409- return
1409+ return ;
14101410 } ;
1411-
1411+
14121412 let value = self . pop_stack ( ) . get_string ( ) ;
14131413 if ctx. set_contents ( value. clone ( ) ) . is_ok ( ) {
14141414 self . stack . push ( Type :: String ( value) ) ;
14151415 } else {
1416- self . stack . push ( Type :: Error ( "get -clipboard" . to_string ( ) ) )
1416+ self . stack . push ( Type :: Error ( "set -clipboard" . to_string ( ) ) )
14171417 } ;
14181418 }
14191419
@@ -1423,11 +1423,10 @@ impl Executor {
14231423 if let Ok ( i) = ClipboardProvider :: new ( ) {
14241424 ctx = i
14251425 } else {
1426- self . stack . push ( Type :: Error ( "set -clipboard" . to_string ( ) ) ) ;
1427- return
1426+ self . stack . push ( Type :: Error ( "get -clipboard" . to_string ( ) ) ) ;
1427+ return ;
14281428 } ;
14291429
1430-
14311430 if let Ok ( contents) = ctx. get_contents ( ) {
14321431 self . stack . push ( Type :: String ( contents) ) ;
14331432 } else {
0 commit comments