diff --git a/bok-utils/src/main.rs b/bok-utils/examples/repos/main.rs similarity index 89% rename from bok-utils/src/main.rs rename to bok-utils/examples/repos/main.rs index 695cd3b..14d4e64 100644 --- a/bok-utils/src/main.rs +++ b/bok-utils/examples/repos/main.rs @@ -15,16 +15,25 @@ * limitations under the License. */ -mod conf; -//mod expanded; -mod repos; +//! +//! Example of two package repositories, where one +//! extends ancd changes another + +// all packages we have +pub mod pkgs; + +pub mod r1; +pub mod r2; + +pub use r1::R1; +pub use r2::R2; fn main() { //let one = repos::pkgs::one::One::default(); use ::std::sync::Arc; - let pkgs1 = Arc::new(repos::R1::default()); - let pkgs2 = Arc::new(repos::R2::default()); + let pkgs1 = Arc::new(R1::default()); + let pkgs2 = Arc::new(R2::default()); use ::bok::Repository; println!("pkgs1: {}", pkgs1.name()); println!("pkgs2: {}", pkgs2.name()); diff --git a/bok-utils/src/repos/pkgs/mod.rs b/bok-utils/examples/repos/pkgs/mod.rs similarity index 100% rename from bok-utils/src/repos/pkgs/mod.rs rename to bok-utils/examples/repos/pkgs/mod.rs diff --git a/bok-utils/src/repos/pkgs/one.rs b/bok-utils/examples/repos/pkgs/one.rs similarity index 100% rename from bok-utils/src/repos/pkgs/one.rs rename to bok-utils/examples/repos/pkgs/one.rs diff --git a/bok-utils/src/repos/pkgs/three.rs b/bok-utils/examples/repos/pkgs/three.rs similarity index 97% rename from bok-utils/src/repos/pkgs/three.rs rename to bok-utils/examples/repos/pkgs/three.rs index 217790f..c0aa435 100644 --- a/bok-utils/src/repos/pkgs/three.rs +++ b/bok-utils/examples/repos/pkgs/three.rs @@ -17,7 +17,7 @@ /// Example package #[::bok::package(::bok::PkgEmpty)] -#[::bok::deps(crate::repos::pkgs::One)] +#[::bok::deps(crate::pkgs::One)] pub struct Three { pub my_attr: u32, } diff --git a/bok-utils/src/repos/pkgs/two.rs b/bok-utils/examples/repos/pkgs/two.rs similarity index 94% rename from bok-utils/src/repos/pkgs/two.rs rename to bok-utils/examples/repos/pkgs/two.rs index 5e9cd6c..feb9ada 100644 --- a/bok-utils/src/repos/pkgs/two.rs +++ b/bok-utils/examples/repos/pkgs/two.rs @@ -16,8 +16,8 @@ */ /// Example package -#[::bok::package(crate::repos::pkgs::one::One)] -#[::bok::deps(crate::repos::pkgs::one::One)] +#[::bok::package(crate::pkgs::one::One)] +#[::bok::deps(crate::pkgs::one::One)] pub struct Two { my_attr2: u32, } diff --git a/bok-utils/src/repos/r1/mod.rs b/bok-utils/examples/repos/r1/mod.rs similarity index 98% rename from bok-utils/src/repos/r1/mod.rs rename to bok-utils/examples/repos/r1/mod.rs index 554daf8..3df9e5f 100644 --- a/bok-utils/src/repos/r1/mod.rs +++ b/bok-utils/examples/repos/r1/mod.rs @@ -19,7 +19,7 @@ //! Example of a simple repository of packages // get the 'pkgs' from somewhere -use crate::repos::pkgs; +use crate::pkgs; /* or you can create and export your own packages pub mod pkgs { diff --git a/bok-utils/src/repos/r2/mod.rs b/bok-utils/examples/repos/r2/mod.rs similarity index 94% rename from bok-utils/src/repos/r2/mod.rs rename to bok-utils/examples/repos/r2/mod.rs index 276f3dc..17d3803 100644 --- a/bok-utils/src/repos/r2/mod.rs +++ b/bok-utils/examples/repos/r2/mod.rs @@ -24,10 +24,10 @@ use ::bok::repository; pub mod pkgs { pub mod one { - pub use crate::repos::pkgs::one::*; + pub use crate::pkgs::one::*; } pub mod two { - pub use crate::repos::pkgs::two::*; + pub use crate::pkgs::two::*; } } diff --git a/bok-utils/src/repos/mod.rs b/bok-utils/src/bin/bok.rs similarity index 61% rename from bok-utils/src/repos/mod.rs rename to bok-utils/src/bin/bok.rs index 657bad6..0eb1564 100644 --- a/bok-utils/src/repos/mod.rs +++ b/bok-utils/src/bin/bok.rs @@ -15,15 +15,27 @@ * limitations under the License. */ -//! -//! Example of two package repositories, where one -//! extends ancd changes another +use ::clap::Parser; -// all packages we have -pub mod pkgs; +/// Simple program to greet a person +#[derive(::clap::Parser, Debug)] +#[command(version, about, long_about = None)] +struct Args { + /// subcommand + #[command(subcommand)] + command: Commands, +} -pub mod r1; -pub mod r2; +/// Available subcommands for `bok` +#[derive(Debug, ::clap::Subcommand)] +enum Commands { + /// Build + Build { + #[arg(long, short)] + path: Option<::std::ffi::OsString>, + }, +} -pub use r1::R1; -pub use r2::R2; +fn main() { + let args = Args::parse(); +} diff --git a/bok-utils/src/conf/mod.rs b/bok-utils/src/conf/mod.rs deleted file mode 100644 index 8d8c288..0000000 --- a/bok-utils/src/conf/mod.rs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright 2024 Luca Fulchir - * - * Licensed under the Apache License, Version 2.0 with LLVM exception (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License and of the exception at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * https://spdx.org/licenses/LLVM-exception.html - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -static CONF: ::bok::Conf = ::bok::Conf {}; - -mod conf { - static CONF: ::bok::Conf = ::bok::Conf {}; -}