27 lines
594 B
Erlang
Executable File
27 lines
594 B
Erlang
Executable File
#!/usr/bin/env escript
|
|
%% -*- erlang -*-
|
|
%%! debug verbose -noshell -pa ebin
|
|
|
|
main([Command|_Args]) ->
|
|
geef:start(),
|
|
case Command of
|
|
"h2r" ->
|
|
[Object|_Rest] = _Args,
|
|
Raw = geef:hex_to_raw(Object),
|
|
io:format("Raw: ~w~n", [Raw]);
|
|
"exists" ->
|
|
[Path|_Rest] = _Args,
|
|
[Object|_None] = _Rest,
|
|
Exists = geef:object_exists(Path, Object),
|
|
io:format("Exists: ~w~n", [Exists]);
|
|
_Else ->
|
|
usage()
|
|
end;
|
|
main(_) ->
|
|
usage().
|
|
|
|
usage() ->
|
|
io:format("usage: ./geef h2r HEX_SHA\n"),
|
|
halt(1).
|
|
|