feat(dist): generate completions, editor syntax, man pages, translations
Ports Ghostty's build-data helpers (main_build_data.zig, src/extra/*, build/mdgen) as the ghostty-build-data binary: bash/zsh/fish completions, Vim syntax/ftdetect/ftplugin/compiler, Sublime syntax (also used by bat), terminfo source and ghostty(1)/ghostty(5) markdown. With the version set to the installed 1.3.1-arch2, all generated files are byte-identical to the installed Ghostty's. - `just docs` renders man pages and HTML with pandoc. - po/: Ghostty's 29 translation catalogs; `just locales` compiles them into the com.mitchellh.ghostty gettext domain. - `just install PREFIX FLATPAK SYSTEM_PACKAGE` installs everything incl. terminfo text/termcap outputs and mirrors GhosttyResources.zig install modes (Flatpak D-Bus template without systemd; lib/systemd/user for system packages). - Build metadata (version, tip/stable channel, commit, build mode) is derived at build time like build_config.zig; GTK/libadwaita compile-time versions come from pkg-config instead of constants. Test Plan: - cargo run -p ghostty-build-data -- +bash | diff - \ /usr/share/bash-completion/completions/ghostty (same for zsh/fish/vim) - just install /tmp/prefix
This commit is contained in:
1 parent
b65bfc575c
commit
b192fdb046
56 files changed
+12614
-16
No files matched your search
@@ -0,0 +1,58 @@
|
||||
// Generated from the Zig multiline strings of extra/zsh.zig. Do not edit.
|
||||
pub const C0: &str = r####"#compdef ghostty
|
||||
|
||||
_fonts () {
|
||||
local font_list=$(ghostty +list-fonts | grep -Z '^[A-Z]')
|
||||
local fonts=(${(f)font_list})
|
||||
_describe -t fonts 'fonts' fonts
|
||||
}
|
||||
|
||||
_themes() {
|
||||
local theme_list=$(ghostty +list-themes | sed -E 's/^(.*) \(.*$/\1/')
|
||||
local themes=(${(f)theme_list})
|
||||
_describe -t themes 'themes' themes
|
||||
}
|
||||
"####;
|
||||
pub const C1: &str = r####"_ghostty() {
|
||||
typeset -A opt_args
|
||||
local context state line
|
||||
local opt=('-e' '--help' '--version')
|
||||
|
||||
_arguments -C \
|
||||
'1:actions:->actions' \
|
||||
'*:: :->rest' \
|
||||
|
||||
if [[ "$line[1]" == "--help" || "$line[1]" == "--version" || "$line[1]" == "-e" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
if [[ "$line[1]" == -* ]]; then
|
||||
_config
|
||||
return
|
||||
fi
|
||||
|
||||
case "$state" in
|
||||
(actions)
|
||||
local actions; actions=(
|
||||
"####;
|
||||
pub const C2: &str = r####" )
|
||||
_describe '' opt
|
||||
_describe -t action 'action' actions
|
||||
;;
|
||||
(rest)
|
||||
if [[ "$line[2]" == "--help" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
local help=('--help')
|
||||
_describe '' help
|
||||
|
||||
case $line[1] in
|
||||
"####;
|
||||
pub const C3: &str = r####" esac
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
_ghostty "$@"
|
||||
"####;
|
||||
Reference in new issue
Block a user