Skip to content

Commit 00a8137

Browse files
Merge branch 'master' into v0.4
* master: Update README.md Update README.md Dependencies updating Update README and minor refactoring
2 parents 0c01147 + dc5d97c commit 00a8137

File tree

2 files changed

+13
-17
lines changed

2 files changed

+13
-17
lines changed

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,19 @@
33
[![Build Status](https://travis-ci.org/alekseysotnikov/CmdTool.svg?branch=master)](https://travis-ci.org/alekseysotnikov/CmdTool) [![codecov](https://codecov.io/gh/alekseysotnikov/CmdTool/branch/master/graph/badge.svg)](https://codecov.io/gh/alekseysotnikov/CmdTool)
44

55
### Quick Overview
6-
Tiny, pure object-oriented, declarative and immutable wrapper of [zt-exec](https://github.com/zeroturnaround/zt-exec) with additional features around a process execution. All features of [zt-exec](https://github.com/zeroturnaround/zt-exec) are still available for usage along with CmdTool.
6+
Tiny, pure object-oriented, declarative and immutable wrapper of [zt-exec](https://github.com/zeroturnaround/zt-exec) with additional features around a process execution.
77

88
Java 8+ required.
99

10-
**Note**: it is an early alpha version, the API may change.
11-
1210
### Motivation
1311
When we call external programs from Java, we certainly need to harvest the output files and output stream. It is ok, but what if we have thousands of calls? They will pollute a disk space if some of them produce files we don't need.
14-
So, we have to do a clean up of disk space if files don't need anymore, just like Java GC frees RAM automatically.
15-
16-
This library solves this small problem and intended to call each command inside a separate directory. It performs particular activities with the directory, such as creating or deleting on appropriate stages of execution (before/after start, after the finish and after stop process).
12+
So, we have to do a clean up of disk space if the files don't need anymore, just like Java GC frees a RAM automatically.
1713

1814
### Features
15+
All features of [zt-exec](https://github.com/zeroturnaround/zt-exec) are supported plus the following:
1916
- Execute command or script
2017
- Save output stream of the process into a file
21-
- Create work directory automatically
22-
- Clean up disk space from a produced data automatically
18+
- Create and clean up work directory automatically
2319

2420
### Download
2521
1. Get the [latest version here](https://github.com/alekseysotnikov/CmdTool/releases) with or without dependencies
@@ -28,13 +24,13 @@ This library solves this small problem and intended to call each command inside
2824
<dependency>
2925
<groupId>org.zeroturnaround</groupId>
3026
<artifactId>zt-exec</artifactId>
31-
<version>1.9</version>
27+
<version>1.10</version>
3228
</dependency>
3329

3430
<dependency>
3531
<groupId>org.cactoos</groupId>
3632
<artifactId>cactoos</artifactId>
37-
<version>0.11</version>
33+
<version>0.11.10</version>
3834
</dependency>
3935
````
4036
### Examples
@@ -48,14 +44,14 @@ new Cmd()
4844
.interpreter("sh") // specify command interpreter
4945
.command("-c", "s='Hello'; echo $s;").execute();
5046
````
51-
or shorter
47+
or even shorter
5248
````java
5349
new Cmd().command("sh", "-c", "s='Hello'; echo $s;").execute();
5450
````
55-
> Execute script in a Shell (Unix-like, Mac OS) and read output
51+
> ... and read output
5652
````java
5753
String output = new Cmd()
58-
.configuring(e -> e.readOutput(true))
54+
.configuring(c -> c.readOutput(true)) // configure zt-exec's executor
5955
.interpreter("sh")
6056
.command("-c", "s='Hello'; echo $s;").execute()
6157
.outputUTF8();
@@ -69,7 +65,7 @@ new Cmd()
6965
.outputFileName("output.txt")
7066
.command("echo", "Hello").execute();
7167
````
72-
> Create work directory before start and delete after finish
68+
> Execute command inside a separate work directory. It creates work directory before start and delete after finish
7369
````java
7470
new Cmd()
7571
.configuring(c -> c.directory(new File("./", "foo"))) // specify work directory ./foo
@@ -80,7 +76,7 @@ new Cmd()
8076
.command("echo", "hello world").execute(); // work directory ./foo will be created automatically
8177
//work directory ./foo was deleted after execution
8278
````
83-
> Run in a background
79+
> Run command in a background
8480
````java
8581
StartedProcess startedProcess = new Cmd().command("echo", "Hello").start();
8682
startedProcess.getFuture().get(); //wait result

pom.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,13 @@
6464
<dependency>
6565
<groupId>org.zeroturnaround</groupId>
6666
<artifactId>zt-exec</artifactId>
67-
<version>1.9</version>
67+
<version>1.10</version>
6868
</dependency>
6969

7070
<dependency>
7171
<groupId>org.cactoos</groupId>
7272
<artifactId>cactoos</artifactId>
73-
<version>0.11</version>
73+
<version>0.11.10</version>
7474
</dependency>
7575
</dependencies>
7676
</project>

0 commit comments

Comments
 (0)