allow to assign automatically current user on new work package
This commit is contained in:
31
src/main.rs
31
src/main.rs
@@ -1,24 +1,25 @@
|
||||
extern crate serde;
|
||||
extern crate clap;
|
||||
extern crate reqwest;
|
||||
extern crate serde;
|
||||
extern crate simple_home_dir;
|
||||
|
||||
mod cli;
|
||||
mod config;
|
||||
mod planning;
|
||||
mod openproject;
|
||||
mod debug;
|
||||
mod error;
|
||||
mod gitlab;
|
||||
mod openproject;
|
||||
mod planning;
|
||||
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
use crate::cli::Commands::{Planning, Test};
|
||||
use crate::cli::Planning::I2work;
|
||||
use crate::error::GeneralError;
|
||||
use clap::Parser;
|
||||
use cli::Cli;
|
||||
use config::Config;
|
||||
use crate::cli::Commands::Planning;
|
||||
use crate::cli::Planning::I2work;
|
||||
use crate::error::GeneralError;
|
||||
use std::fs;
|
||||
use std::path::PathBuf;
|
||||
use std::process::exit;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
@@ -29,13 +30,16 @@ async fn main() {
|
||||
|
||||
let config_path = match cli.config.as_deref() {
|
||||
Some(p) => p,
|
||||
None => &default_config_path
|
||||
None => &default_config_path,
|
||||
};
|
||||
|
||||
let config_path_content = match fs::read_to_string(config_path) {
|
||||
Ok(content) => content,
|
||||
Err(e) => {
|
||||
println!("Could not read config file at {:?}, error: {}", config_path, e);
|
||||
println!(
|
||||
"Could not read config file at {:?}, error: {}",
|
||||
config_path, e
|
||||
);
|
||||
exit(1);
|
||||
}
|
||||
};
|
||||
@@ -44,7 +48,10 @@ async fn main() {
|
||||
|
||||
let result = match cli.command {
|
||||
Some(Planning(I2work(args))) => planning::issue2work::issue2work(config, &args).await,
|
||||
None => Err(GeneralError{description: "No command launched".to_string()})
|
||||
Some(Test) => debug::debug(config).await,
|
||||
None => Err(GeneralError {
|
||||
description: "No command launched".to_string(),
|
||||
}),
|
||||
};
|
||||
|
||||
match result {
|
||||
|
||||
Reference in New Issue
Block a user