File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ fn main() {
7676 . arg (
7777 Arg :: new ( "filename" )
7878 . required ( true )
79- . help ( "The file containing the code for the Technique you want to type- check." ) ,
79+ . help ( "The file containing the code for the Technique you want to parse and type check, or - to read from standard input ." ) ,
8080 ) ,
8181 )
8282 . subcommand (
@@ -101,7 +101,7 @@ fn main() {
101101 . arg (
102102 Arg :: new ( "filename" )
103103 . required ( true )
104- . help ( "The file containing the code for the Technique you want to format." ) ,
104+ . help ( "The file containing the code for the Technique you want to format, or - to read from standard input ." ) ,
105105 ) ,
106106 )
107107 . subcommand (
Original file line number Diff line number Diff line change 1+ use owo_colors:: OwoColorize ;
12use serde:: Serialize ;
23use std:: io:: Write ;
34use std:: path:: Path ;
@@ -25,6 +26,13 @@ pub(crate) fn via_typst(filename: &Path, markup: &str) {
2526 info ! ( "Printing file: {}" , filename. display( ) ) ;
2627
2728 // Verify that the file actually exists
29+ if filename. to_str ( ) == Some ( "-" ) {
30+ eprintln ! (
31+ "{}: Unable to render to PDF from standard input." ,
32+ "error" . bright_red( )
33+ ) ;
34+ std:: process:: exit ( 1 ) ;
35+ }
2836 if !filename. exists ( ) {
2937 panic ! (
3038 "Supplied procedure file does not exist: {}" ,
You can’t perform that action at this time.
0 commit comments