use builtin;
use str;
set edit:completion:arg-completer[neomake] = {|@words|
fn spaces {|n|
builtin:repeat $n ' ' | str:join ''
}
fn cand {|text desc|
edit:complex-candidate $text &display=$text' '(spaces (- 14 (wcswidth $text)))$desc
}
var command = 'neomake'
for word $words[1..-1] {
if (str:has-prefix $word '-') {
break
}
set command = $command';'$word
}
var completions = [
&'neomake'= {
cand -e 'Enables experimental features.'
cand --experimental 'Enables experimental features.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
cand man 'Renders the manual.'
cand autocomplete 'Renders shell completion scripts.'
cand workflow 'Workflow related subcommands.'
cand plan 'Creates an execution plan.'
cand execute 'Executes an execution plan.'
cand describe 'Describes which nodes are executed in which stages.'
cand list 'Lists all available nodes.'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'neomake;man'= {
cand -o 'o'
cand --out 'out'
cand -f 'f'
cand --format 'format'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;autocomplete'= {
cand -o 'o'
cand --out 'out'
cand -s 's'
cand --shell 'shell'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;workflow'= {
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
cand init 'Initializes a new template workflow.'
cand schema 'Renders the workflow schema to STDOUT.'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'neomake;workflow;init'= {
cand -t 'The template to init with.'
cand --template 'The template to init with.'
cand -o 'The file to render the output to. "-" renders to STDOUT.'
cand --output 'The file to render the output to. "-" renders to STDOUT.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;workflow;schema'= {
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;workflow;help'= {
cand init 'Initializes a new template workflow.'
cand schema 'Renders the workflow schema to STDOUT.'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'neomake;workflow;help;init'= {
}
&'neomake;workflow;help;schema'= {
}
&'neomake;workflow;help;help'= {
}
&'neomake;plan'= {
cand --workflow 'The workflow file to use.'
cand -n 'Adding a node to the plan.'
cand --node 'Adding a node to the plan.'
cand -r 'Adding a node to the plan.'
cand --regex 'Adding a node to the plan.'
cand -a 'Specifies a value for handlebars placeholders.'
cand --arg 'Specifies a value for handlebars placeholders.'
cand -o 'Specifies the output format.'
cand --output 'Specifies the output format.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;execute'= {
cand -f 'The format of the execution plan.'
cand --format 'The format of the execution plan.'
cand -w 'Defines how many worker threads are created in the OS thread pool.'
cand --workers 'Defines how many worker threads are created in the OS thread pool.'
cand --no-stdout 'Disables any output to STDOUT. Useful for preventing leakage of secrets and keeping the logs clean.'
cand --no-stderr 'Disables any output to STDERR. Useful for preventing leakage of secrets and keeping the logs clean.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;describe'= {
cand --workflow 'The workflow file to use.'
cand -n 'Adding a node.'
cand --node 'Adding a node.'
cand -r 'Adding a node to the plan.'
cand --regex 'Adding a node to the plan.'
cand -o 'The output format.'
cand --output 'The output format.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;list'= {
cand --workflow 'The workflow file to use.'
cand -o 'The output format.'
cand --output 'The output format.'
cand -h 'Print help'
cand --help 'Print help'
cand -V 'Print version'
cand --version 'Print version'
}
&'neomake;help'= {
cand man 'Renders the manual.'
cand autocomplete 'Renders shell completion scripts.'
cand workflow 'Workflow related subcommands.'
cand plan 'Creates an execution plan.'
cand execute 'Executes an execution plan.'
cand describe 'Describes which nodes are executed in which stages.'
cand list 'Lists all available nodes.'
cand help 'Print this message or the help of the given subcommand(s)'
}
&'neomake;help;man'= {
}
&'neomake;help;autocomplete'= {
}
&'neomake;help;workflow'= {
cand init 'Initializes a new template workflow.'
cand schema 'Renders the workflow schema to STDOUT.'
}
&'neomake;help;workflow;init'= {
}
&'neomake;help;workflow;schema'= {
}
&'neomake;help;plan'= {
}
&'neomake;help;execute'= {
}
&'neomake;help;describe'= {
}
&'neomake;help;list'= {
}
&'neomake;help;help'= {
}
]
$completions[$command]
}