cargo_gazelle/args.rs
1// Copyright Materialize, Inc. and contributors. All rights reserved.
2//
3// Use of this software is governed by the Business Source License
4// included in the LICENSE file.
5//
6// As of the Change Date specified in that file, in accordance with
7// the Business Source License, use of this software will be governed
8// by the Apache License, Version 2.0.
9
10use std::path::PathBuf;
11
12use clap::Parser;
13
14#[derive(Parser, Debug)]
15#[clap(author, version, about, long_about = None)]
16pub struct Args {
17 /// Path to an executable that can be used to format `BUILD.bazel` files.
18 #[clap(long, value_name = "FORMATTER", env = "FORMATTER")]
19 pub formatter: Option<PathBuf>,
20 /// Path to the Cargo binary for gathering metadata about a crate.
21 #[clap(long, value_name = "CARGO_BINARY", env = "CARGO_BINARY")]
22 pub cargo: Option<PathBuf>,
23 /// Doesn't actually update any files, just checks if they would have changed.
24 #[clap(long)]
25 pub check: bool,
26 /// Path to a `Cargo.toml` file to generate a `BUILD.bazel` file for.
27 ///
28 /// Can be a path to a single crate or a workspace.
29 #[clap(value_name = "CARGO_TOML")]
30 pub path: PathBuf,
31}