@@ -6,6 +6,7 @@ use std::{env, process, str::FromStr};
66use structopt:: StructOpt ;
77use tectonic_status_base:: plain:: PlainStatusBackend ;
88
9+ use structopt:: clap;
910use tectonic:: {
1011 config:: PersistentConfig ,
1112 errors:: SyncError ,
@@ -36,6 +37,10 @@ mod v2cli {
3637#[ derive( Debug , StructOpt ) ]
3738#[ structopt( name = "Tectonic" , about = "Process a (La)TeX document" ) ]
3839struct CliOptions {
40+ /// Use experimental V2 interface (see `tectonic -X --help`); must be the first argument
41+ #[ structopt( short = "X" ) ]
42+ use_v2 : bool ,
43+
3944 /// How much chatter to print when running
4045 #[ structopt( long = "chatter" , short, name = "level" , default_value = "default" , possible_values( & [ "default" , "minimal" ] ) ) ]
4146 chatter_level : String ,
@@ -127,6 +132,15 @@ fn main() {
127132 Box :: new ( PlainStatusBackend :: new ( chatter_level) ) as Box < dyn StatusBackend >
128133 } ;
129134
135+ if args. use_v2 {
136+ let err = clap:: Error :: with_description (
137+ "-X option must be the first argument if given" ,
138+ clap:: ErrorKind :: ArgumentConflict ,
139+ ) ;
140+ status. report_error ( & err. into ( ) ) ;
141+ process:: exit ( 1 )
142+ }
143+
130144 // Now that we've got colorized output, pass off to the inner function ...
131145 // all so that we can print out the word "error:" in red. This code
132146 // parallels various bits of the `error_chain` crate.
0 commit comments