mirror of
https://github.com/RGBCube/ncc
synced 2025-08-02 13:07:46 +00:00
Compare commits
No commits in common. "e3096645a875cd6960ed0fbd363f591c354e77fc" and "b4919a59901ea380eb55559d4395ea09c336fa03" have entirely different histories.
e3096645a8
...
b4919a5990
2 changed files with 1 additions and 70 deletions
|
@ -24,65 +24,6 @@ def --env mcg [path: path]: nothing -> nothing {
|
||||||
jj git init --colocate
|
jj git init --colocate
|
||||||
}
|
}
|
||||||
|
|
||||||
def --env "nu-complete jc" [] {
|
|
||||||
if $env.__NU_COMPLETE_JC? != null {
|
|
||||||
return $env.__NU_COMPLETE_JC
|
|
||||||
}
|
|
||||||
|
|
||||||
let options = try {
|
|
||||||
let options = ^jc --help
|
|
||||||
| collect
|
|
||||||
| parse "{_}Parsers:\n{_}\n\nOptions:\n{inherent}\n\nSlice:{_}"
|
|
||||||
| get 0
|
|
||||||
|
|
||||||
let parsers = ^jc --about
|
|
||||||
| from json
|
|
||||||
| get parsers
|
|
||||||
| select argument description
|
|
||||||
| rename value description
|
|
||||||
|
|
||||||
let inherent = $options.inherent
|
|
||||||
| lines
|
|
||||||
| parse " {short}, {long} {description}"
|
|
||||||
| update description { str trim }
|
|
||||||
| each {|record|
|
|
||||||
[[value, description];
|
|
||||||
[$record.short, $record.description],
|
|
||||||
[$record.long, $record.description]]
|
|
||||||
}
|
|
||||||
| flatten
|
|
||||||
|
|
||||||
$parsers ++ $inherent
|
|
||||||
} catch {
|
|
||||||
[]
|
|
||||||
}
|
|
||||||
|
|
||||||
$env.__NU_COMPLETE_JC = $options
|
|
||||||
|
|
||||||
$options
|
|
||||||
}
|
|
||||||
|
|
||||||
# Run `jc` (JSON Converter).
|
|
||||||
def --wrapped jc [...arguments: string@"nu-complete jc"]: [any -> table, any -> record, any -> string] {
|
|
||||||
let run = ^jc ...$arguments | complete
|
|
||||||
|
|
||||||
if $run.exit_code != 0 {
|
|
||||||
error make {
|
|
||||||
msg: "jc exection failed"
|
|
||||||
label: {
|
|
||||||
text: ($run.stderr | str replace "jc:" "" | str replace "Error -" "" | str trim)
|
|
||||||
span: (metadata $arguments).span
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if "--help" in $arguments or "-h" in $arguments {
|
|
||||||
$run.stdout
|
|
||||||
} else {
|
|
||||||
$run.stdout | from json
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# `nu-highlight` with default colors
|
# `nu-highlight` with default colors
|
||||||
#
|
#
|
||||||
# Custom themes can produce a lot more ansi color codes and make the output
|
# Custom themes can produce a lot more ansi color codes and make the output
|
||||||
|
@ -354,18 +295,9 @@ let menus = [
|
||||||
marker: $env.PROMPT_INDICATOR
|
marker: $env.PROMPT_INDICATOR
|
||||||
type: {
|
type: {
|
||||||
layout: ide
|
layout: ide
|
||||||
min_completion_width: 0
|
|
||||||
max_completion_width: 150
|
|
||||||
max_completion_height: 25
|
|
||||||
padding: 0
|
|
||||||
border: false
|
border: false
|
||||||
cursor_offset: 0
|
|
||||||
description_mode: "prefer_right"
|
|
||||||
min_description_width: 0
|
|
||||||
max_description_width: 50
|
|
||||||
max_description_height: 10
|
|
||||||
description_offset: 1
|
|
||||||
correct_cursor_pos: true
|
correct_cursor_pos: true
|
||||||
|
max_completion_height: 25
|
||||||
}
|
}
|
||||||
style: {
|
style: {
|
||||||
text: white
|
text: white
|
||||||
|
|
|
@ -14,7 +14,6 @@ in {
|
||||||
fastfetch
|
fastfetch
|
||||||
fd
|
fd
|
||||||
hyperfine
|
hyperfine
|
||||||
jc
|
|
||||||
moreutils
|
moreutils
|
||||||
openssl
|
openssl
|
||||||
p7zip
|
p7zip
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue