Skip to content

Commit 912f980

Browse files
committed
fixed issue where having descriptors would override parameters
1 parent 0b69987 commit 912f980

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
@@ -182,16 +182,16 @@ mod doc {
182182
take_until_and_consume!(delims.comm),
183183
take_until_and_consume!("\n")
184184
))
185-
>> desc: opt!(many0!(complete!(map_res!(
185+
>> par: opt!(many0!(complete!(map_res!(
186186
preceded!(
187-
take_until_and_consume!(delims.opt),
187+
take_until_and_consume!(delims.params),
188188
take_until_and_consume!("\n")
189189
),
190190
as_kv
191191
))))
192-
>> par: opt!(many0!(complete!(map_res!(
192+
>> desc: opt!(many0!(complete!(map_res!(
193193
preceded!(
194-
take_until_and_consume!(delims.params),
194+
take_until_and_consume!(delims.opt),
195195
take_until_and_consume!("\n")
196196
),
197197
as_kv
@@ -663,4 +663,23 @@ mod tests {
663663
);
664664
}
665665
}
666+
667+
#[test]
668+
fn param_and_input() {
669+
let sample = "#\"
670+
# mp()
671+
# Convert from markdown to docx
672+
# @param input: markdown file to convert
673+
# - MSG: the message to pass
674+
#;
675+
";
676+
let delims = Delimiters::get_delims();
677+
let x = Extracted {
678+
content: sample.into(),
679+
position: Span::new(CompleteStr(sample))
680+
};
681+
682+
let val = generate_doc_file(&[x], Path::new("/example.txt"), delims);
683+
println!("{:#?}", val);
684+
}
666685
}

0 commit comments

Comments
 (0)