Fix elvish 0.18 compatibility
This commit is contained in:
parent
7a8f6207f9
commit
22b5ba1dfa
|
@ -5,5 +5,5 @@ use ./completion/kcp
|
||||||
use ./completion/mpv
|
use ./completion/mpv
|
||||||
use ./completion/pacman
|
use ./completion/pacman
|
||||||
use ./completion/ssh
|
use ./completion/ssh
|
||||||
#use ./completion/sudo
|
use ./completion/sudo
|
||||||
use ./completion/use
|
use ./completion/use
|
||||||
|
|
|
@ -27,7 +27,7 @@ fn -comp-commands {
|
||||||
fn -comp-inline-files {|archive|
|
fn -comp-inline-files {|archive|
|
||||||
try {
|
try {
|
||||||
arc ls $archive | eawk {|_ @argv| put $argv[-1] }
|
arc ls $archive | eawk {|_ @argv| put $argv[-1] }
|
||||||
} except e {
|
} catch e {
|
||||||
nop
|
nop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -46,7 +46,7 @@ fn -complete-remote-dir {|port address dir|
|
||||||
ssh -p $port $address $cmd | each {|f|
|
ssh -p $port $address $cmd | each {|f|
|
||||||
put (printf '%s:%s' $address $f)
|
put (printf '%s:%s' $address $f)
|
||||||
}
|
}
|
||||||
} except e { }
|
} catch e { }
|
||||||
}
|
}
|
||||||
|
|
||||||
fn -complete-args {|hosts cmd @argv|
|
fn -complete-args {|hosts cmd @argv|
|
||||||
|
|
|
@ -40,7 +40,7 @@ fn -s {|&sort=$false &type=exact @motive|
|
||||||
$f $m | peach {|e|
|
$f $m | peach {|e|
|
||||||
set result[$e] = $nil
|
set result[$e] = $nil
|
||||||
}
|
}
|
||||||
} except e { }
|
} catch e { }
|
||||||
} $motive
|
} $motive
|
||||||
}
|
}
|
||||||
-r $sort $result
|
-r $sort $result
|
||||||
|
|
|
@ -38,7 +38,7 @@ fn int {|v|
|
||||||
var n = (math:trunc $v)
|
var n = (math:trunc $v)
|
||||||
var s @_ = (str:split '.' (to-string $n))
|
var s @_ = (str:split '.' (to-string $n))
|
||||||
put $s
|
put $s
|
||||||
} except e {
|
} catch e {
|
||||||
fail (printf '%s n’est pas un nombre' $v)
|
fail (printf '%s n’est pas un nombre' $v)
|
||||||
}
|
}
|
||||||
} elif (eq $k 'number') {
|
} elif (eq $k 'number') {
|
||||||
|
|
Loading…
Reference in New Issue