Add tilde_utils
This commit is contained in:
parent
1133c0f697
commit
3a170716a7
29
tilde_utils.moo
Normal file
29
tilde_utils.moo
Normal file
@ -0,0 +1,29 @@
|
||||
@create $generic_utils named "Tilde Utilities"
|
||||
@property #0.tilde_utils #170
|
||||
|
||||
@describe $tilde_utils as "This is the Tilde Utilities utility package. See `help $tilde_utils' for more details."
|
||||
@set $tilde_utils.help_msg to {"Mirrored functions:", " curl (STR <url> [, INT <include_headers>, INT timeout]) -- See `help curl()`", " exec (LIST command[, STR input][, LIST environment variables]) -- See `help eval()`"}
|
||||
|
||||
@verb $tilde_utils:exec tnt
|
||||
@program $tilde_utils:exec
|
||||
{command, ?input=#-1, ?env_vars=#-1} = args;
|
||||
if (env_vars != #-1)
|
||||
return exec (command, input, env_vars);
|
||||
elseif (input != #-1)
|
||||
return exec (command, input);
|
||||
else
|
||||
return exec (command);
|
||||
endif
|
||||
.
|
||||
|
||||
@verb $tilde_utils:curl tnt
|
||||
@program $tilde_utils:curl
|
||||
{url, ?include_headers=#-1, ?timeout=#-1} = args;
|
||||
if (timeout != #-1)
|
||||
return curl (url, include_headers, timeout);
|
||||
elseif (include_headers != #-1)
|
||||
return curl (url, include_headers);
|
||||
else
|
||||
return curl (url);
|
||||
endif
|
||||
.
|
Loading…
x
Reference in New Issue
Block a user