fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
b31387416
master
1# localization: skip(private) 2function __fish_theme_cat -a theme_name 3set -l theme_path( __fish_theme_paths $theme_name )[ 1 ] 4if not set -q theme_path[ 1 ] 5echo >&2 "No such theme: $theme_name " 6echo >&2 Searched( __fish_theme_dir ) "and `status list-files themes`" 7return 1 8end 9set -l theme_data( if string match -q'/*' --$theme_path ;cat $theme_path ;else status get-file$theme_path ;end ) 10set -l allowed_lines\ 11'\s*' \ 12'\s*#.*' \ 13'\[(dark|light|unknown)\]' \ 14( __fish_theme_variable_filter ) 15set allowed_lines"^($ ( string join -- '|' $allowed_lines ) )\$" 16printf '%s\n' $theme_data | string match -rvq --$allowed_lines 17and for linein $theme_data 18string match -rq --$allowed_lines $theme_data 19or printf >&2 "error: unsupported line in theme '%s': %s\n" $theme_name $line 20end 21string join\n $theme_data 22true 23end