Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions custom-completions/op/op-completions.nu
Original file line number Diff line number Diff line change
Expand Up @@ -1979,11 +1979,11 @@ def "nu completion duration" [ctx: string] {
if ($duration | parse --regex ".*?(\\d+)$" | is-not-empty) {
[s m h d w] | each {|e|
let label = match $e {
s => "seconds"
m => "minutes"
h => "hours"
d => "days"
w => "weeks"
"s" => "seconds"
"m" => "minutes"
"h" => "hours"
"d" => "days"
"w" => "weeks"
}
{value: $"($duration)($e)", description: $"+($duration | parse --regex '.*?(?<value>\d+)$' | last | get value | into float) ($label)"}
}
Expand Down
8 changes: 4 additions & 4 deletions modules/completion-generator/completion-generator.nu
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,14 @@ export def 'from tree' [
$acc
} else {
match ($acc.schema | describe -d | get type) {
record => {
"record" => {
if $x in $acc.schema {
$acc | merge { schema: ($acc.schema | get $x) }
} else {
$acc
}
}
list => {
"list" => {
let fst = $acc.schema.0? | describe -d | get type
if not ($fst in ['list', 'record']) {
$acc
Expand All @@ -50,7 +50,7 @@ export def 'from tree' [
}
}
match ($menu.schema | describe -d | get type) {
record => {
"record" => {
$menu.schema
| transpose k v
| each {|i|
Expand All @@ -61,7 +61,7 @@ export def 'from tree' [
}
}
}
list => {
"list" => {
if ($menu.schema.0? | describe -d | get type) == 'record' {
$menu.schema
| each {|x| {$selector.value: null, $selector.description: null} | merge $x }
Expand Down
4 changes: 2 additions & 2 deletions toolkit.nu
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,15 @@ export def "lint check" []: path -> int {
const current_path = (path self)

let diagnostics = match $test_methodology {
ide-check => {
"ide-check" => {
nu --ide-check 10 $file
| $"[($in)]"
| from nuon
| where type == diagnostic
| select severity message
}

import-or-source => {
"import-or-source" => {
# If any line in the file starts with `export`, then
# we assume it is a module. Otherwise, treat it as source
let has_exports = (open $file | $in like '(?m)^export\s')
Expand Down