From ba4653878529aa79de7c34cb28e3e0db97a16f87 Mon Sep 17 00:00:00 2001 From: Auca Coyan Date: Sun, 21 Jul 2024 09:21:21 -0300 Subject: [PATCH] :bug: 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` --- modules/network/remoting/remoting.nu | 4 ++-- sourced/misc/cmd_stats.nu | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/network/remoting/remoting.nu b/modules/network/remoting/remoting.nu index 7ef7733..2aaba27 100644 --- a/modules/network/remoting/remoting.nu +++ b/modules/network/remoting/remoting.nu @@ -22,7 +22,7 @@ def "nu-complete hosts" [] { } def "nu-complete scripts" [] { - $nu.scope.commands + scope commands |where is_custom |get -i command } @@ -62,7 +62,7 @@ export def "ssh script" [ ...args # arguments you wish to pass to the script in key=value format ] { 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 full_command = (build-string (view-source $script) '; ' $script ' ' ($args|str join ' ') '|to json -r') diff --git a/sourced/misc/cmd_stats.nu b/sourced/misc/cmd_stats.nu index 8968ed8..deecb43 100644 --- a/sourced/misc/cmd_stats.nu +++ b/sourced/misc/cmd_stats.nu @@ -1,10 +1,10 @@ -let builtin = ($nu.scope.commands | where is_builtin == true | length) -let subcmd = ($nu.scope.commands | where is_sub == true | length) -let plugin = ($nu.scope.commands | where is_plugin == true | length) -let custom = ($nu.scope.commands | where is_custom == true | length) -let keyword = ($nu.scope.commands | where is_keyword == true | length) -let extern = ($nu.scope.commands | where is_extern == true | length) -let total = ($nu.scope.commands | length) +let builtin = (scope commands | where is_builtin == true | length) +let subcmd = (scope commands | where is_sub == true | length) +let plugin = (scope commands | where is_plugin == true | length) +let custom = (scope commands | where is_custom == true | length) +let keyword = (scope commands | where is_keyword == true | length) +let extern = (scope commands | where is_extern == true | length) +let total = (scope commands | length) [ [command_type count]; @@ -15,4 +15,4 @@ let total = ($nu.scope.commands | length) [keyword $keyword] [extern $extern] [total_cmds $total] -] \ No newline at end of file +]