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

General refactor + tests #19

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
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
79 changes: 0 additions & 79 deletions src/config.rs

This file was deleted.

2 changes: 1 addition & 1 deletion src/list.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::config::Scenario;
use crate::scenario::Scenario;

pub fn show_list(scenarios: &[Scenario]) {
for scenario in scenarios.iter() {
Expand Down
12 changes: 6 additions & 6 deletions src/main.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
extern crate clap;

use clap::{App, Arg};
use clap::{App, AppSettings, Arg};

mod config;
mod list;
mod run;
mod scenario;

#[tokio::main]
async fn main() {
Expand All @@ -13,7 +13,7 @@ async fn main() {
.subcommand(App::new("list").about("list available event sets"))
.subcommand(
App::new("run")
.about("injects a specific set of events")
.about("publish a specific set of events")
.arg(
Arg::new("url")
.short('u')
Expand All @@ -32,11 +32,11 @@ async fn main() {
.required(false),
),
)
.setting(AppSettings::ArgRequiredElseHelp)
.get_matches();

let config = config::get_config_file_content();

let scenarios = config::parse_scenarios(config);
let config = scenario::get_config_file_content();
let scenarios = scenario::parse_scenarios(config);

if options.subcommand_matches("list").is_some() {
list::show_list(&scenarios);
Expand Down
2 changes: 1 addition & 1 deletion src/run.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::config::Scenario;
use crate::scenario::Scenario;
use reqwest::StatusCode;
use std::fs;

Expand Down