Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Give a proper project structure to fakemall #3

Merged
merged 1 commit into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file removed src/builder.rs
Empty file.
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod set;
13 changes: 3 additions & 10 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
mod set;

use anyhow::Result;
use clap::{Parser, Subcommand};

Expand All @@ -10,6 +8,9 @@ use std::{
path::PathBuf,
process,
};

use fakemall::set;

/// A simple tool for building fake command line interfaces
#[derive(Parser)]
#[command(author, version, about, long_about = None)]
Expand All @@ -28,13 +29,6 @@ enum Commands {
/// Command to execute
command: String,
},
/// Save a command output to a set
Save {
/// Set to save command to
set: String,
/// Command to save
command: String,
},
/// Build an environment from a set
Build {
/// Set to build
Expand All @@ -49,7 +43,6 @@ fn main() -> Result<()> {

match &cli.command {
Commands::Exec { set, command } => exec(set, command.trim()),
Commands::Save { .. } => todo!(),
Commands::Build { set, path } => build(set, path),
}
}
Expand Down
1 change: 1 addition & 0 deletions src/set.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use anyhow::Result;
use serde::Deserialize;

#[derive(Debug, Deserialize)]
pub struct Set {
pub commands: Vec<Command>,
Expand Down