mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-01 06:37:46 +00:00
🐛 parser fixes (#801)
- replace `str collect` for `str join` - replace `str lpad` for `fill` - `str lpad -c` for `fill --width` - `str rpad -l` for `fill --alignment r --width` - updated `before_v0.60/README.md` - `$nu.scope.commands` for `scope commands` - add a couple of `if (true) {} else {}` (else keyword) - `$true` for `true` - `$false` for `false`
This commit is contained in:
parent
be32cdaefc
commit
ba46538785
2 changed files with 10 additions and 10 deletions
|
@ -22,7 +22,7 @@ def "nu-complete hosts" [] {
|
||||||
}
|
}
|
||||||
|
|
||||||
def "nu-complete scripts" [] {
|
def "nu-complete scripts" [] {
|
||||||
$nu.scope.commands
|
scope commands
|
||||||
|where is_custom
|
|where is_custom
|
||||||
|get -i command
|
|get -i command
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ export def "ssh script" [
|
||||||
...args # arguments you wish to pass to the script in key=value format
|
...args # arguments you wish to pass to the script in key=value format
|
||||||
] {
|
] {
|
||||||
let span = (metadata $script).span
|
let span = (metadata $script).span
|
||||||
if $script in ($nu.scope.commands|where is_custom|get command) {
|
if $script in (scope commands|where is_custom|get command) {
|
||||||
|
|
||||||
let host = (hosts|where name == $hostname|get 0)
|
let host = (hosts|where name == $hostname|get 0)
|
||||||
let full_command = (build-string (view-source $script) '; ' $script ' ' ($args|str join ' ') '|to json -r')
|
let full_command = (build-string (view-source $script) '; ' $script ' ' ($args|str join ' ') '|to json -r')
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
let builtin = ($nu.scope.commands | where is_builtin == true | length)
|
let builtin = (scope commands | where is_builtin == true | length)
|
||||||
let subcmd = ($nu.scope.commands | where is_sub == true | length)
|
let subcmd = (scope commands | where is_sub == true | length)
|
||||||
let plugin = ($nu.scope.commands | where is_plugin == true | length)
|
let plugin = (scope commands | where is_plugin == true | length)
|
||||||
let custom = ($nu.scope.commands | where is_custom == true | length)
|
let custom = (scope commands | where is_custom == true | length)
|
||||||
let keyword = ($nu.scope.commands | where is_keyword == true | length)
|
let keyword = (scope commands | where is_keyword == true | length)
|
||||||
let extern = ($nu.scope.commands | where is_extern == true | length)
|
let extern = (scope commands | where is_extern == true | length)
|
||||||
let total = ($nu.scope.commands | length)
|
let total = (scope commands | length)
|
||||||
|
|
||||||
[
|
[
|
||||||
[command_type count];
|
[command_type count];
|
||||||
|
@ -15,4 +15,4 @@ let total = ($nu.scope.commands | length)
|
||||||
[keyword $keyword]
|
[keyword $keyword]
|
||||||
[extern $extern]
|
[extern $extern]
|
||||||
[total_cmds $total]
|
[total_cmds $total]
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue