Skip to content

Commit 8c01b6d

Browse files
authored
Merge pull request #877 from clbarnes/v2-cli-doc
src/bin/tectonic/main.rs: -X option in CLI docs
2 parents 734cb66 + ff5e011 commit 8c01b6d

4 files changed

Lines changed: 31 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ tokio = "0.1.22"
120120

121121
[package.metadata.vcpkg]
122122
git = "https://github.com/microsoft/vcpkg"
123-
rev = "997cd412fa4dff71bec6c99dea95f0b9a3c2c240"
123+
rev = "6b6a35335c9064fac2ec6684c4f79808dce59b7d"
124124

125125
[package.metadata.vcpkg.target]
126126
x86_64-apple-darwin = { install = ["freetype","harfbuzz[icu,graphite2]"] }

dist/azure-build-and-test-vcpkg.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ steps:
2222

2323
- bash: |
2424
set -xeuo pipefail
25-
brew install pkg-config
25+
brew install automake libtool pkg-config
2626
displayName: "Install vcpkg dependencies (macOS)"
2727
condition: and(succeeded(), eq(variables['Agent.OS'], 'Darwin'))
2828

src/bin/tectonic/main.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::{env, process, str::FromStr};
66
use structopt::StructOpt;
77
use tectonic_status_base::plain::PlainStatusBackend;
88

9+
use structopt::clap;
910
use 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")]
3839
struct 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.

tests/executable.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,3 +883,18 @@ fn extra_search_paths() {
883883
);
884884
error_or_panic(&output);
885885
}
886+
887+
/// -X in non-initial position fails
888+
#[test]
889+
fn bad_v2_position() {
890+
let output = run_tectonic(&PathBuf::from("."), &["-", "-X"]);
891+
error_or_panic(&output);
892+
}
893+
894+
#[cfg(feature = "serialization")]
895+
#[test]
896+
fn bad_v2_position_build() {
897+
let (_tempdir, temppath) = setup_v2();
898+
let output = run_tectonic(&temppath, &["build", "-X"]);
899+
error_or_panic(&output);
900+
}

0 commit comments

Comments
 (0)