Function jirust_cli::process_command

source ·
pub async fn process_command(
    command: Commands,
    config_file_path: String,
    cfg_data: ConfigFile,
) -> Result<(), Box<dyn Error>>
Expand description

Processes the command passed to the CLI

§Arguments

  • command - The command to execute
  • config_file_path - The path to the configuration file
  • cfg_data - The configuration file data

§Returns

  • A Result containing the result of the command execution

§Errors

  • If the command execution fails

§Examples

use jirust_cli::process_command;
use jirust_cli::config::config_file::ConfigFile;
use jirust_cli::args::commands::{Commands, VersionArgs, VersionActionValues};

let config_file_path = String::from("config.json");
let args = VersionArgs {
  version_act: VersionActionValues::List,
  project: "project_key".to_string(),
  project_id: None,
  version_id: Some("97531".to_string()),
  version_name: Some("version_name".to_string()),
  version_description: Some("version_description".to_string()),
  version_start_date: None,
  version_release_date: None,
  version_archived: None,
  version_released: Some(true),
  version_page_size: None,
  version_page_offset: None,
};

let result = process_command(Commands::Version(args), config_file_path, ConfigFile::default());