#[derive(Debug, Clone, serde::Serialize)]
pub struct ProjectProfile {
pub name: String,
pub language: Language,
pub has_cli: bool,
pub cli_command: Option<Vec<String>>,
pub cli_help_output: Option<String>,
#[serde(default)]
pub cli_subcommand_help: Vec<(String, String)>,
pub repo_url: Option<String>,
pub license: Option<String>,
pub version: Option<String>,
pub authors: Option<String>,
pub description_hint: Option<String>,
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, serde::Serialize)]
#[serde(rename_all = "lowercase")]
pub enum Language {
Rust,
Node,
Python,
Go,
Ruby,
Unknown,
}
impl Language {
pub fn as_str(self) -> &'static str {
match self {
Self::Rust => "rust",
Self::Node => "node",
Self::Python => "python",
Self::Go => "go",
Self::Ruby => "ruby",
Self::Unknown => "unknown",
}
}
}
#[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct Intent {
pub one_line_description: String,
pub when_to_use_phrases: Vec<String>,
pub invocation_command: Option<String>,
pub import_pattern: Option<String>,
pub author: Option<String>,
pub license: Option<String>,
}
impl Intent {
#[allow(dead_code)]
pub fn is_pure_library(&self) -> bool {
self.invocation_command.is_none()
}
}