Skip to content

Latest commit

 

History

History
78 lines (58 loc) · 1.88 KB

CONTRIBUTING.md

File metadata and controls

78 lines (58 loc) · 1.88 KB

Contributing to pacaptr

Welcome to pacaptr!

Please note that this project is in a very early stage, and the conventions and the APIs could be changed. Some discussions concerning certain crucial design choices haven't been made yet.

Contents

Style Conventions

Project Structure

Please note that this is subject to change.

  • dispatch: This module handles argument parsing and environment detection. The Opt structure is generated by clap, which then generates the correct package_manager::PackageManager trait object according to the environmental context, and then call the corresponding trait method.

    mod dispatch {
        #[derive(Clap)]
        struct Opt;
    }
  • error: This module defines the basic error type used in this crate. Anyhow? It's possible! Not just yet...

    mod error;
  • exec: This module launches subprocesses.

    mod exec {
        enum Mode {
            DryRun,
            Mute,
            ..
        }
    
        fn exec( .. ) -> Result< .. , error::Error>;
        ..
    }
  • print:
    This module handles output format.

  • package_manager: Here is where the things really happen. If you want to add package manager support, please declare submodules here.

    mod packagemanager {
        mod homebrew {
            struct Homebrew;
    
            impl Homebrew {
                fn suy( .. ) -> Result< .. , error::Error>;
                ..
            }
        }
        ..
    
        trait PackageManager { .. }
    }