mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 07:07:46 +00:00
Added custom completions for loco
and cargo loco
commands (#1029)
This commit is contained in:
parent
dbcecf2653
commit
10b22626f7
2 changed files with 818 additions and 0 deletions
112
custom-completions/loco/loco-completions.nu
Normal file
112
custom-completions/loco/loco-completions.nu
Normal file
|
@ -0,0 +1,112 @@
|
|||
def "nu-complete loco new log" [] {
|
||||
{
|
||||
options: {
|
||||
case_sensitive: false,
|
||||
completion_algorithm: fuzzy,
|
||||
sort: false,
|
||||
},
|
||||
completions: [
|
||||
"off"
|
||||
"error"
|
||||
"warn"
|
||||
"info"
|
||||
"debug"
|
||||
"trace"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete loco new db" [] {
|
||||
{
|
||||
options: {
|
||||
case_sensitive: false,
|
||||
completion_algorithm: fuzzy,
|
||||
sort: false,
|
||||
},
|
||||
completions: [
|
||||
"sqlite"
|
||||
"postgres"
|
||||
"none"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete loco new bg" [] {
|
||||
{
|
||||
options: {
|
||||
case_sensitive: false,
|
||||
completion_algorithm: fuzzy,
|
||||
sort: false,
|
||||
},
|
||||
completions: [
|
||||
"async"
|
||||
"queue"
|
||||
"blocking"
|
||||
"none"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete loco new os" [] {
|
||||
{
|
||||
options: {
|
||||
case_sensitive: false,
|
||||
completion_algorithm: fuzzy,
|
||||
sort: false,
|
||||
},
|
||||
completions: [
|
||||
"windows"
|
||||
"linux"
|
||||
"macos"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete loco new assets" [] {
|
||||
{
|
||||
options: {
|
||||
case_sensitive: false,
|
||||
completion_algorithm: fuzzy,
|
||||
sort: false,
|
||||
},
|
||||
completions: [
|
||||
"serverside"
|
||||
"clientside"
|
||||
"none"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def "nu-complete loco subcommands" [] {
|
||||
{
|
||||
options: {
|
||||
sort: false
|
||||
},
|
||||
completions : [
|
||||
{ value: "new", description: "Create a new Loco app" },
|
||||
{ value: "help", description: "Print this message or the help of the given subcommand(s)" },
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
# Loco new app generator
|
||||
export extern "loco" [
|
||||
subcommand?: string@"nu-complete loco subcommands"
|
||||
--log(-l): string@"nu-complete loco new log" = "error" # Verbosity level
|
||||
--help(-h) # Print help
|
||||
--version(-V) # Print version
|
||||
]
|
||||
|
||||
# Create a new Loco app
|
||||
export extern "loco new" [
|
||||
--log(-l): string@"nu-complete loco new log" = "error" # Verbosity level
|
||||
--path(-p): path = "." # Local path to generate into
|
||||
--name(-n): string # App name
|
||||
--db: string@"nu-complete loco new db" # Database provider
|
||||
--bg: string@"nu-complete loco new bg" # Background worker configuration
|
||||
--assets: string@"nu-complete loco new assets" # Assets serving configuration
|
||||
--allow-in-git-repo(-a) # Create the starter in target git repository
|
||||
--os: string@"nu-complete loco new os" = "linux" # Create a Unix (linux, mac) or Windows optimized starter
|
||||
--help(-h) # Print help
|
||||
--version(-V) # Print version
|
||||
]
|
Loading…
Add table
Add a link
Reference in a new issue