# Generates a list of variables based on a default theme. This script
# automatically adds known variables to the generated list.

printf "\
// This file is automatically generated by generate-variables-list.sh,
// which you can find at the root of the crate.

/// A list of all variable names.
pub const VARIABLES: &[&str] = &[
" > $2

sed -r "s/(\w+)=.+/    \"\1\",/" $1 > /tmp/variable_list
printf "\
    \"chat_serviceBackground\",
    \"chat_serviceBackgroundSelected\",
    \"chats_menuTopBackground\",
    \"chats_menuTopShadow\",
    \"chats_menuTopShadowCats\",
    \"chat_wallpaper\",
    \"chat_wallpaper_gradient_to\"," >> /tmp/variable_list
LC_COLLATE=C sort /tmp/variable_list >> $2

printf "];\n" >> $2
