tasks a-s
This commit is contained in:
parent
47bf37c096
commit
b83f433714
12433 changed files with 156208 additions and 123 deletions
|
|
@ -0,0 +1,18 @@
|
|||
:- module env_var.
|
||||
:- interface.
|
||||
|
||||
:- import_module io.
|
||||
:- pred main(io::di, io::uo) is det.
|
||||
|
||||
:- implementation.
|
||||
:- import_module maybe, string.
|
||||
|
||||
main(!IO) :-
|
||||
io.get_environment_var("HOME", MaybeValue, !IO),
|
||||
(
|
||||
MaybeValue = yes(Value),
|
||||
io.write_string("HOME is " ++ Value ++ "\n", !IO)
|
||||
;
|
||||
MaybeValue = no,
|
||||
io.write_string("environment variable HOME not set\n", !IO)
|
||||
).
|
||||
Loading…
Add table
Add a link
Reference in a new issue