Skip to content

Commit 9a65dbd

Browse files
committed
add whoami command
1 parent a2b1197 commit 9a65dbd

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/io/github/benas/unixstream/UnixStream.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,14 @@ static UnixStream<Path> pwd() {
151151
return new UnixStreamImpl<>(Stream.of(Paths.get("").toAbsolutePath()));
152152
}
153153

154+
/**
155+
* Create a new UnixStream with the current user.
156+
*
157+
* @return a new UnixStream with the current user.
158+
*/
159+
static UnixStream<String> whoami() {
160+
return new UnixStreamImpl<>(Stream.of(System.getProperty("user.name")));
161+
}
154162

155163
/**
156164
* Find files by name (recursively) in a given directory.

0 commit comments

Comments
 (0)