delonix completion

Autocompletion dinâmico para shells, e realce de sintaxe do VMfile para editores.

Dynamic autocompletion for shells, and VMfile syntax highlighting for editors.

Dois braços que respondem à mesma pergunta — o que é preciso dizer a uma shell ou a um editor para reconhecerem este binário — sob um só tecto desde a B2 da reestruturação da CLI (syntax <editor> dobrou-se aqui). completion shell imprime o script de registo do shell: a engine é dinâmica, pede as sugestões ao próprio binário em tempo real, a partir da MESMA definição usada no parsing — nunca fica desactualizado à mão.

completion editor dá o realce de sintaxe do VMfile: sem extensão, como um Dockerfile, nenhum editor o reconhece sozinho — e sem realce a instrução mal escrita que o parser recusa (ele falha FECHADO) parece igual a todo o resto até ao momento do build. A gramática sai do BINÁRIO e não do repositório, pela mesma razão que as completions são geradas: a instalação documentada é curl … | bash, sem repositório de onde copiar, e uma gramática guardada noutro sítio afasta-se do parser que devia descrever. O scripts/install.sh instala-a sozinho onde encontrar um destes editores.

Two arms answering the same question — what a shell or an editor needs to be told to recognise this binary — under one roof since the CLI restructuring's B2 (syntax <editor> folded in here). completion shell prints the shell registration script: the engine is dynamic, it asks the binary itself for suggestions in real time, from the SAME definition used for parsing — it never goes stale by hand.

completion editor gives VMfile syntax highlighting: no extension, like a Dockerfile, so no editor recognises it on its own — and without highlighting, the misspelled instruction the parser refuses (it fails CLOSED) looks like every other line until build time. The grammar comes out of the BINARY, not the repository, for the same reason the completions are generated: the documented install is curl … | bash, with no repository to copy from, and a grammar kept anywhere else drifts from the parser it is meant to describe. scripts/install.sh installs it wherever it finds one of these editors.

Usage: delonix completion [OPTIONS] <COMMAND>

Commands:
  editor  VMfile syntax highlighting for an editor (vim/vscode)
  shell   Print the shell autocompletion script (bash/zsh/fish/...)
  help    Print this message or the help of the given subcommand(s)

Options:
      --l18n <en|pt>
          Output language: `en` (default) or `pt` (Portuguese, pt_AO). Also settable via `$DELONIX_L18N`. Global — works before any subcommand

  -h, --help
          Print help (see a summary with '-h')

COMMAND MAP:
  completion  shell · editor

EXAMPLES:
  # what a shell needs to complete this CLI
  delonix completion shell bash

  # what an editor needs to colour a VMfile
  delonix completion editor vim

SEE ALSO:
  delonix version · delonix init · delonix dashboard

  delonix › completion

completion shell

Print the shell autocompletion script (bash/zsh/fish/...)

Usage: delonix completion shell [OPTIONS] <SHELL>

Arguments:
  <SHELL>
          Target shell
          
          [possible values: bash, zsh, fish, elvish, powershell]

Options:
      --l18n <en|pt>
          Output language: `en` (default) or `pt` (Portuguese, pt_AO). Also settable via `$DELONIX_L18N`. Global — works before any subcommand

  -h, --help
          Print help (see a summary with '-h')

EXAMPLES:
  # bash, into the user's own completion directory
  delonix completion shell bash > ~/.local/share/bash-completion/completions/delonix

  # zsh, into a directory already on your fpath
  delonix completion shell zsh > ~/.zfunc/_delonix

  # fish
  delonix completion shell fish > ~/.config/fish/completions/delonix.fish

SEE ALSO:
  delonix completion editor · delonix man

  delonix › completion › shell

ExemplosExamples

Bash (persistente)
Bash (persistent)
echo 'source <(delonix completion shell bash)' >> ~/.bashrc
Zsh
Zsh
echo 'source <(delonix completion shell zsh)' >> ~/.zshrc

completion editor

VMfile syntax highlighting for an editor (vim/vscode)

Usage: delonix completion editor [OPTIONS] <EDITOR>

Arguments:
  <EDITOR>
          Target editor
          
          [possible values: vim, vscode]

Options:
      --dir <DIR>
          Write the editor's files into this directory instead of printing one to stdout

      --l18n <en|pt>
          Output language: `en` (default) or `pt` (Portuguese, pt_AO). Also settable via `$DELONIX_L18N`. Global — works before any subcommand

  -h, --help
          Print help (see a summary with '-h')

EXAMPLES:
  # VMfile highlighting for vim/neovim
  delonix completion editor vim

  # the same, written into an extension directory
  delonix completion editor vscode --dir ~/.vscode/extensions/delonix

SEE ALSO:
  delonix completion shell · delonix man

  delonix › completion › editor

ExemplosExamples

vim/neovim — a sintaxe E o ftdetect que a activa
vim/neovim — the syntax AND the ftdetect that activates it
delonix completion editor vim --dir ~/.vim
VS Code, como directoria de extensão
VS Code, as an extension directory
delonix completion editor vscode --dir ~/.vscode/extensions/delonix.vmfile-0.1.0
Só a gramática, para a colocares onde quiseres
Just the grammar, to put wherever you want
delonix completion editor vim > ~/.vim/syntax/vmfile.vim

LaboratórioLab

Autocompletion real, gerado a partir da MESMA definição da CLI — nunca fica desactualizado à mão.

echo 'source <(delonix completion shell bash)' >> ~/.bashrc
source ~/.bashrc
delonix con<TAB>

Real autocompletion, generated from the SAME CLI definition — it never goes stale by hand.

echo 'source <(delonix completion shell bash)' >> ~/.bashrc
source ~/.bashrc
delonix con<TAB>

DesafioChallenge

Compara o output de delonix completion shell bash entre duas versões do binário (antes/depois de um upgrade) — confirma que um comando novo aparece sozinho no script, sem qualquer edição manual.

Compare the output of delonix completion shell bash between two binary versions (before/after an upgrade) — confirm a new command shows up in the script by itself, with no manual editing.