rp_cli/
input.rs

1use std::fs;
2use std::path;
3
4pub struct RunInput {
5    pub mode: String,
6    pub channel: String,
7    pub edition: String,
8    pub backtrace: bool,
9    pub file_path: path::PathBuf,
10}
11
12pub struct FmtInput {
13    pub edition: String,
14    pub file_path: path::PathBuf,
15}
16
17pub struct ShareInput {
18    pub file_path: path::PathBuf,
19}
20
21pub struct DownloadInput {
22    pub id_or_url: String,
23}
24
25pub fn code_from_path(file_path: &path::PathBuf) -> Result<String, Box<std::error::Error>> {
26    let body = fs::read_to_string(file_path)?;
27    Ok(body)
28}