mirror of
https://github.com/TECHNOFAB11/pay-respects.git
synced 2025-12-12 06:20:09 +01:00
fix: opts spacing
This commit is contained in:
parent
e53c61cb59
commit
87be5ffacb
5 changed files with 26 additions and 7 deletions
|
|
@ -42,10 +42,17 @@ pub fn opts(
|
|||
let regex = opt.trim();
|
||||
let current_tag = tag(tag_name, replace_tag);
|
||||
let token_tag: TokenStream2 = format!("{}{}", tag_name, replace_tag).parse().unwrap();
|
||||
let command = quote! {
|
||||
let #token_tag = format!(" {}", opt_regex(#regex, &mut last_command));
|
||||
let opts = quote! {
|
||||
let caps = opt_regex(#regex, &mut last_command);
|
||||
let #token_tag = {
|
||||
if caps.is_empty() {
|
||||
"".to_string()
|
||||
} else {
|
||||
format!(" {}", caps)
|
||||
}
|
||||
};
|
||||
};
|
||||
opt_list.push(command);
|
||||
opt_list.push(opts);
|
||||
|
||||
replace_list.push(rtag(tag_name, replace_tag, ¤t_tag));
|
||||
suggest.replace_range(placeholder, ¤t_tag);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue