Skip to content

Commit

Permalink
Description (#8)
Browse files Browse the repository at this point in the history
* feat: added description

* docs: added description to docs
  • Loading branch information
lars-vc authored Aug 3, 2022
1 parent a89df96 commit ff68ca5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Example step configuration:
"args": [
{
"id": "config",
"type": "any"
"type": "any",
"description": "config argument"
},
{
"id": "a_default_value",
Expand Down
12 changes: 12 additions & 0 deletions src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,12 @@ impl Command {
"Set up stream reader {}",
arg_style.apply_to(&arg.id)
);
if !arg.description.is_empty() {
println!(
"Description: {}",
arg_style.apply_to(&arg.description),
);
}
let ids = extract_string_array(&arg.other, "sourceIds")
.unwrap_or_default();

Expand Down Expand Up @@ -206,6 +212,12 @@ impl Command {
arg_style.apply_to(&arg.id),
type_style.apply_to(&arg.ty)
);
if !arg.description.is_empty() {
println!(
"Description: {}",
arg_style.apply_to(&arg.description),
);
}

if let Ok(inp) = Input::<String>::new()
.with_prompt(" ")
Expand Down
2 changes: 2 additions & 0 deletions src/step.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ pub struct StepArg {
pub default: bool,
#[serde(default)]
pub value: String,
#[serde(default)]
pub description: String,
}

#[derive(Serialize, Deserialize, Debug)]
Expand Down

0 comments on commit ff68ca5

Please sign in to comment.