mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
Case insensitive and reformatted make completions (#515)
* case-insensitive makefile completion * format makefile completions
This commit is contained in:
parent
c698547b3b
commit
35db6d1e28
1 changed files with 60 additions and 51 deletions
|
@ -1,56 +1,65 @@
|
||||||
def "nu-complete make" [] {
|
def "nu-complete make" [] {
|
||||||
open ./Makefile|lines|find ':'|where ($it|str starts-with '.') == false|split column ' '|get column1|find ':'|str replace ':' ''
|
ls
|
||||||
}
|
| find --ignore-case makefile
|
||||||
|
| open $in.0.name
|
||||||
|
| lines
|
||||||
|
| find ':'
|
||||||
|
| where ($it | str starts-with '.') == false
|
||||||
|
| split column ' '
|
||||||
|
| get column1
|
||||||
|
| find ':'
|
||||||
|
| str replace ':' ''
|
||||||
|
}
|
||||||
|
|
||||||
def "nu-complete make jobs" [] {
|
def "nu-complete make jobs" [] {
|
||||||
seq 1 (sys|get cpu|length)
|
seq 1 (sys | get cpu | length)
|
||||||
}
|
}
|
||||||
|
|
||||||
def "nu-complete make files" [] {
|
def "nu-complete make files" [] {
|
||||||
ls **/*|where type == file|get name
|
ls **/* | where type == file | get name
|
||||||
}
|
}
|
||||||
|
|
||||||
def "nu-complete make dirs" [] {
|
def "nu-complete make dirs" [] {
|
||||||
ls **/*|where type == dir|get name
|
ls **/* | where type == dir | get name
|
||||||
}
|
}
|
||||||
|
|
||||||
export extern "make" [
|
export extern "make" [
|
||||||
command?: string@"nu-complete make"
|
command?: string@"nu-complete make"
|
||||||
--always-make(-B) # Unconditionally make all targets.
|
--always-make(-B) # Unconditionally make all targets.
|
||||||
--directory(-C): string@"nu-complete make dirs" # Change to DIRECTORY before doing anything.
|
--directory(-C): string@"nu-complete make dirs" # Change to DIRECTORY before doing anything.
|
||||||
--debug(-d) # Print various types of debugging information.
|
--debug(-d) # Print various types of debugging information.
|
||||||
--environment-overrides(-e) # Environment variables override makefiles.
|
--environment-overrides(-e) # Environment variables override makefiles.
|
||||||
--eval(-E): string # Evaluate STRING as a makefile statement.
|
--eval(-E): string # Evaluate STRING as a makefile statement.
|
||||||
--file(-f) # Read FILE as a makefile.
|
--file(-f) # Read FILE as a makefile.
|
||||||
--help(-h) # Print this message and exit.
|
--help(-h) # Print this message and exit.
|
||||||
--ignore-errors(-i) # Ignore errors from recipes.
|
--ignore-errors(-i) # Ignore errors from recipes.
|
||||||
--include-dir(-I): string@"nu-complete make dirs" # Search DIRECTORY for included makefiles.
|
--include-dir(-I): string@"nu-complete make dirs" # Search DIRECTORY for included makefiles.
|
||||||
--jobs(-j): int@"nu-complete make jobs" # Allow N jobs at once; infinite jobs with no arg.
|
--jobs(-j): int@"nu-complete make jobs" # Allow N jobs at once; infinite jobs with no arg.
|
||||||
--keep-going(-k) # Keep going when some targets can't be made.
|
--keep-going(-k) # Keep going when some targets can't be made.
|
||||||
--load-average(-l): int@"nu-complete make jobs" # Don't start multiple jobs unless load is below N.
|
--load-average(-l): int@"nu-complete make jobs" # Don't start multiple jobs unless load is below N.
|
||||||
--check-symlink-times(-L) # Use the latest mtime between symlinks and target.
|
--check-symlink-times(-L) # Use the latest mtime between symlinks and target.
|
||||||
--just-print(-n) # Don't actually run any recipe; just print them.
|
--just-print(-n) # Don't actually run any recipe; just print them.
|
||||||
--dry-run
|
--dry-run
|
||||||
--recon
|
--recon
|
||||||
--assume-old: string@"nu-complete make files" # Consider FILE to be very old and don't remake it.
|
--assume-old: string@"nu-complete make files" # Consider FILE to be very old and don't remake it.
|
||||||
--old-file(-o): string@"nu-complete make files"
|
--old-file(-o): string@"nu-complete make files"
|
||||||
--output-sync(-O) # Synchronize output of parallel jobs by TYPE.
|
--output-sync(-O) # Synchronize output of parallel jobs by TYPE.
|
||||||
--print-data-base(-p) # Print make's internal database.
|
--print-data-base(-p) # Print make's internal database.
|
||||||
--question(-q) # Run no recipe; exit status says if up to date.
|
--question(-q) # Run no recipe; exit status says if up to date.
|
||||||
--no-builtin-rules(-r) # Disable the built-in implicit rules.
|
--no-builtin-rules(-r) # Disable the built-in implicit rules.
|
||||||
--no-builtin-variables(-R) # Disable the built-in variable settings.
|
--no-builtin-variables(-R) # Disable the built-in variable settings.
|
||||||
--silent(-s) # Don't echo recipes.
|
--silent(-s) # Don't echo recipes.
|
||||||
--quiet
|
--quiet
|
||||||
--no-silent # Echo recipes (disable --silent mode).
|
--no-silent # Echo recipes (disable --silent mode).
|
||||||
--stop(-S) # Turns off -k.
|
--stop(-S) # Turns off -k.
|
||||||
--no-keep-going
|
--no-keep-going
|
||||||
--touch(-t) # Touch targets instead of remaking them.
|
--touch(-t) # Touch targets instead of remaking them.
|
||||||
--trace # Print tracing information.
|
--trace # Print tracing information.
|
||||||
--version(-v) # Print the version number of make and exit.
|
--version(-v) # Print the version number of make and exit.
|
||||||
--print-directory(-w) # Print the current directory.
|
--print-directory(-w) # Print the current directory.
|
||||||
--no-print-directory # Turn off -w, even if it was turned on implicitly.
|
--no-print-directory # Turn off -w, even if it was turned on implicitly.
|
||||||
--what-if(-W): string@"nu-complete make files" # Consider FILE to be infinitely new.
|
--what-if(-W): string@"nu-complete make files" # Consider FILE to be infinitely new.
|
||||||
--new-file: string@"nu-complete make files"
|
--new-file: string@"nu-complete make files"
|
||||||
--assume-new: string@"nu-complete make files"
|
--assume-new: string@"nu-complete make files"
|
||||||
--warn-undefined-variables # Warn when an undefined variable is referenced.
|
--warn-undefined-variables # Warn when an undefined variable is referenced.
|
||||||
]
|
]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue