diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 0ed1233..ed44eb2 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -10,6 +10,7 @@ pub fn cli() -> Command { .subcommands([ create(), search(), + info(), install(), remove(), upgrade(), @@ -83,6 +84,13 @@ fn search() -> Command { ]) } +fn info() -> Command { + Command::new("info") + .about("Display information about a specific package") + .arg(Arg::new("name") + .required(true)) +} + fn install() -> Command { Command::new("install") .about("Install packages") diff --git a/src/hooks/mod.rs b/src/hooks/mod.rs new file mode 100644 index 0000000..9646c9b --- /dev/null +++ b/src/hooks/mod.rs @@ -0,0 +1,14 @@ +use std::error::Error; + +#[non_exhaustive] +pub enum Hooks { + Man, + GlibSchema, + Info, +} + +impl Hooks { + pub fn run(&self) -> Result<(), Box> { + unimplemented!(); + } +} diff --git a/src/lib.rs b/src/lib.rs index 857da04..d151aa5 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,6 @@ #![warn(clippy::all, clippy::pedantic)] mod item; +mod hooks; mod package; mod plist; mod repository; @@ -7,6 +8,7 @@ mod version; pub use { item::Item, + hooks::Hooks, package::{Dependency, Package}, plist::*, repository::Repository, diff --git a/src/package/mod.rs b/src/package/mod.rs index f7858c4..1e0802d 100644 --- a/src/package/mod.rs +++ b/src/package/mod.rs @@ -19,13 +19,31 @@ pub struct Group { #[derive(Clone, Debug, Serialize, Deserialize, PartialEq)] pub struct Package { - name: String, - version: Version, - release: u32, - plist: Plist, - size: usize, - dependencies: Vec, - users: Option>, - groups: Option>, - post_install: Option, + /// The name of the package minus all version information + pub name: String, + /// The `Version` of the package + pub version: Version, + /// The release number for this package + pub release: u32, + /// a single line description of the package + pub description: String, + /// a more verbose description of the package + pub long_description: String, + /// an optional link to an + /// [AppStream](https://www.freedesktop.org/wiki/Distributions/AppStream/) + /// metadata file + pub appstream_data: Option, + /// a listing of all files, directories and symlinks which are a part of + /// this package + pub plist: Plist, + /// the total size of this package + pub size: usize, + /// all of this package's runtime dependencies + pub dependencies: Vec, + /// an optional list of users to be created upon installation + pub users: Option>, + /// an optional list of groups to be created upon installation + pub groups: Option>, + /// an optional post installation shell script to be run + pub post_install: Option, }