Skip to content

Commit f07baff

Browse files
authored
Merge pull request #1043 from xinslu/master
Added ability to specify target of build
2 parents a3389b9 + 1786aa3 commit f07baff

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

docs/src/v2cli/build.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ tectonic -X build
1818
[--print]
1919
[--open]
2020
[--untrusted]
21+
[--target NAME]
2122
```
2223

2324
#### Remarks
@@ -32,6 +33,10 @@ directory.
3233

3334
#### Command-Line Options
3435

36+
The `--target` option will only build the
37+
[output](../ref/tectonic-toml.md#output) with the specified name. If this option
38+
is not given, all outputs will be built.
39+
3540
The `--keep-intermediates` option (or `-k` for short) will cause the engine to
3641
save intermediate files (such as `mydoc.aux` or `mydoc.bbl`) in the build output
3742
directory. By default, these files are stored in memory but not actually written

src/bin/tectonic/v2cli.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,10 @@ pub struct BuildCommand {
238238
/// Open built document using system handler
239239
#[structopt(long)]
240240
open: bool,
241+
242+
/// Specify a target to be used by the build
243+
#[structopt(long, help = "Specify the target of the build.")]
244+
target: Option<String>,
241245
}
242246

243247
impl BuildCommand {
@@ -262,6 +266,12 @@ impl BuildCommand {
262266
setup_options.only_cached(self.only_cached);
263267

264268
for output_name in doc.output_names() {
269+
if let Some(out) = self.target.as_ref() {
270+
if out != output_name {
271+
continue;
272+
}
273+
}
274+
265275
let mut builder = doc.setup_session(output_name, &setup_options, status)?;
266276

267277
builder

0 commit comments

Comments
 (0)