-module(gladvent). -compile([no_auto_import, nowarn_unused_vars, nowarn_unused_function]). -export([main/0]). -spec print_snag_and_halt(snag:snag()) -> nil. print_snag_and_halt(Err) -> _pipe = Err, _pipe@1 = snag:pretty_print(_pipe), gleam@io:println(_pipe@1), erlang:halt(1). -spec main() -> nil. main() -> Commands = begin _pipe = glint:new(), _pipe@1 = glint:global_flag( _pipe, <<"year"/utf8>>, gladvent@internal@cmd:year_flag() ), _pipe@2 = glint:with_pretty_help(_pipe@1, glint:default_pretty_help()), _pipe@3 = glint:add( _pipe@2, [<<"new"/utf8>>], gladvent@internal@cmd@new:new_command() ), _pipe@4 = glint:add( _pipe@3, [<<"run"/utf8>>], gladvent@internal@cmd@run:run_command() ), glint:add( _pipe@4, [<<"run"/utf8>>, <<"all"/utf8>>], gladvent@internal@cmd@run:run_all_command() ) end, glint:run_and_handle( Commands, gleam@erlang:start_arguments(), fun(Out) -> case Out of {ok, Out@1} -> _pipe@5 = Out@1, _pipe@6 = gleam@string:join(_pipe@5, <<"\n\n"/utf8>>), gleam@io:println(_pipe@6); {error, Err} -> print_snag_and_halt(Err) end end ).