swift_package/conf/
args.rs1use camino_fs::Utf8PathBuf;
2
3xflags::xflags! {
4 src "./src/conf/args.rs"
5
6 cmd swift-package {
8
9 optional --quiet
11
12 optional -p, --package package: String
14
15 repeated -v, --verbose
17
18 optional --unstable-flags unstable_flags: String
20
21 optional -r, --release
23
24 optional --profile profile: String
26
27 repeated -f, --features features: String
29
30 optional --all-features
32
33 optional --no-default-features
35
36 optional --target-dir target_dir: Utf8PathBuf
38
39 optional --manifest-path manifest_path: Utf8PathBuf
41
42 }
43}
44
45#[derive(Debug)]
49pub struct SwiftPackage {
50 pub quiet: bool,
51 pub package: Option<String>,
52 pub verbose: u32,
53 pub unstable_flags: Option<String>,
54 pub release: bool,
55 pub profile: Option<String>,
56 pub features: Vec<String>,
57 pub all_features: bool,
58 pub no_default_features: bool,
59 pub target_dir: Option<Utf8PathBuf>,
60 pub manifest_path: Option<Utf8PathBuf>,
61}
62
63impl SwiftPackage {
64 #[allow(dead_code)]
65 pub fn from_env_or_exit() -> Self {
66 Self::from_env_or_exit_()
67 }
68
69 #[allow(dead_code)]
70 pub fn from_env() -> xflags::Result<Self> {
71 Self::from_env_()
72 }
73
74 #[allow(dead_code)]
75 pub fn from_vec(args: Vec<std::ffi::OsString>) -> xflags::Result<Self> {
76 Self::from_vec_(args)
77 }
78}
79