mirror of
https://github.com/clap-rs/clap
synced 2024-11-14 00:27:13 +00:00
Merge pull request #3285 from cherryblossom000/elvish-0.17
fix(complete): Use Elvish v0.17 lambda syntax
This commit is contained in:
commit
df0e6d8637
2 changed files with 12 additions and 12 deletions
|
@ -25,11 +25,11 @@ impl Generator for Elvish {
|
|||
use builtin;
|
||||
use str;
|
||||
|
||||
set edit:completion:arg-completer[{bin_name}] = [@words]{{
|
||||
fn spaces [n]{{
|
||||
set edit:completion:arg-completer[{bin_name}] = {{|@words|
|
||||
fn spaces {{|n|
|
||||
builtin:repeat $n ' ' | str:join ''
|
||||
}}
|
||||
fn cand [text desc]{{
|
||||
fn cand {{|text desc|
|
||||
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
|
||||
}}
|
||||
var command = '{bin_name}'
|
||||
|
|
|
@ -34,11 +34,11 @@ static ELVISH: &str = r#"
|
|||
use builtin;
|
||||
use str;
|
||||
|
||||
set edit:completion:arg-completer[my_app] = [@words]{
|
||||
fn spaces [n]{
|
||||
set edit:completion:arg-completer[my_app] = {|@words|
|
||||
fn spaces {|n|
|
||||
builtin:repeat $n ' ' | str:join ''
|
||||
}
|
||||
fn cand [text desc]{
|
||||
fn cand {|text desc|
|
||||
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
|
||||
}
|
||||
var command = 'my_app'
|
||||
|
@ -94,11 +94,11 @@ static ELVISH_SPECIAL_CMDS: &str = r#"
|
|||
use builtin;
|
||||
use str;
|
||||
|
||||
set edit:completion:arg-completer[my_app] = [@words]{
|
||||
fn spaces [n]{
|
||||
set edit:completion:arg-completer[my_app] = {|@words|
|
||||
fn spaces {|n|
|
||||
builtin:repeat $n ' ' | str:join ''
|
||||
}
|
||||
fn cand [text desc]{
|
||||
fn cand {|text desc|
|
||||
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
|
||||
}
|
||||
var command = 'my_app'
|
||||
|
@ -180,11 +180,11 @@ static ELVISH_ALIASES: &str = r#"
|
|||
use builtin;
|
||||
use str;
|
||||
|
||||
set edit:completion:arg-completer[cmd] = [@words]{
|
||||
fn spaces [n]{
|
||||
set edit:completion:arg-completer[cmd] = {|@words|
|
||||
fn spaces {|n|
|
||||
builtin:repeat $n ' ' | str:join ''
|
||||
}
|
||||
fn cand [text desc]{
|
||||
fn cand {|text desc|
|
||||
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
|
||||
}
|
||||
var command = 'cmd'
|
||||
|
|
Loading…
Reference in a new issue