Skip to content

Commit 9fbf40c

Browse files
Merge pull request #3 from dustinknopoff/development
fixed issue where having descriptors would override parameters
2 parents b1dff88 + 912f980 commit 9fbf40c

File tree

2 files changed

+24
-5
lines changed

2 files changed

+24
-5
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bashdoc"
3-
version = "0.5.1"
3+
version = "0.5.2"
44
authors = ["Dustin Knopoff <dustinknopoff@gmail.com>"]
55
description = """
66
A tool for generating documentation/help menu for user defined bash functions.

src/docs.rs

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,16 @@ mod doc {
207207
take_until_and_consume!(delims.comm),
208208
take_until_and_consume!("\n")
209209
))
210-
>> desc: opt!(many0!(complete!(map_res!(
210+
>> par: opt!(many0!(complete!(map_res!(
211211
preceded!(
212-
take_until_and_consume!(delims.opt),
212+
take_until_and_consume!(delims.params),
213213
take_until_and_consume!("\n")
214214
),
215215
as_kv
216216
))))
217-
>> par: opt!(many0!(complete!(map_res!(
217+
>> desc: opt!(many0!(complete!(map_res!(
218218
preceded!(
219-
take_until_and_consume!(delims.params),
219+
take_until_and_consume!(delims.opt),
220220
take_until_and_consume!("\n")
221221
),
222222
as_kv
@@ -670,4 +670,23 @@ mod tests {
670670
);
671671
}
672672
}
673+
674+
#[test]
675+
fn param_and_input() {
676+
let sample = "#\"
677+
# mp()
678+
# Convert from markdown to docx
679+
# @param input: markdown file to convert
680+
# - MSG: the message to pass
681+
#;
682+
";
683+
let delims = Delimiters::get_delims();
684+
let x = Extracted {
685+
content: sample.into(),
686+
position: Span::new(CompleteStr(sample))
687+
};
688+
689+
let val = generate_doc_file(&[x], Path::new("/example.txt"), delims);
690+
println!("{:#?}", val);
691+
}
673692
}

0 commit comments

Comments
 (0)