From b85694b60cdaf95e4f4e4406908c9724bfc931ad Mon Sep 17 00:00:00 2001 From: Howard <139238193+howard-oc@users.noreply.github.com> Date: Tue, 23 Apr 2024 21:23:30 +0100 Subject: [PATCH] Update README.md Signed-off-by: Howard <139238193+howard-oc@users.noreply.github.com> --- README.md | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 767ee21..bc4456c 100644 --- a/README.md +++ b/README.md @@ -4,5 +4,40 @@ Kratix-Utils is a ready-to-run collection of functions that help to fullfil a pr The goal of kratix_utils is to help you establish best practices and consistent formatting across multiple promises, and ensure developers are adhering to those conventions. +### How to use kratix_utils +```bash +cd internal/configure-pipeline +cargo new sample +``` +### In the main.rs include a call to run_pipeline +```bash +use log::LevelFilter; +use log4rs::append::console::ConsoleAppender; +use log4rs::config::{Appender, Root}; +use log4rs::Config; +use std::{env, process}; -Kratix Utils is licensed under a MIT License. \ No newline at end of file +fn main() { + let stdout = ConsoleAppender::builder().build(); + let config = Config::builder() + .appender(Appender::builder().build("stdout", Box::new(stdout))) + .build(Root::builder().appender("stdout").build(LevelFilter::Trace)) + .unwrap(); + + let _handle = log4rs::init_config(config).unwrap(); + + let args: Vec = env::args().collect(); + + // TODO: pass function to do IOC transform + match args[1].as_str() { + "pipeline" => kratix_utils::run_pipeline(args), + _ => { + log::warn!("Unknown command: {}", args[1]); + process::exit(1); + } + } +} +``` + + +Kratix Utils is licensed under a MIT License.