printenv.icl 389 Bytes
Newer Older
Ronny Wichers Schreur's avatar
Ronny Wichers Schreur committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/*
	Version 1.0.1
	Ronny Wichers Schreur
	ronny@cs.kun.nl
*/
module printenv

import StdEnv, ArgEnv

Start
	| argc == 1
		=	format (getEnvironmentVariable argv.[1])
	| otherwise
		=	"usage: " +++ argv.[0] +++ " <variable>\n"
	where
		argc
			=	size argv - 1
		argv
			=	getCommandLine

		format EnvironmentVariableUndefined
			=	""
		format (EnvironmentVariable value)
			=	value +++ "\n"