Skip to content

Commit 6c716ad

Browse files
committed
Update readme
1 parent e8cbcde commit 6c716ad

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ pass `command`, `execCommand` and `args` as options. This will call the respecti
165165

166166
* `__construct($options = null)`
167167
* `$options`: either a command string or an options array (see `setOptions()`)
168+
* `__toString()`: The result from `getExecCommand()`
168169
* `setOptions($options)`: Set command options
169170
* `$options`: array of name => value options that should be applied to the object.
170171
You can also pass options that use a setter, e.g. you can pass a `command` option which
@@ -176,22 +177,27 @@ pass `command`, `execCommand` and `args` as options. This will call the respecti
176177
* `getCommand()`: The command that was set through `setCommand()` or passed to the constructor.
177178
* `getExecCommand()`: The full command string to execute.
178179
* `setArgs($args)`: Set argument as string
179-
* `$args`: The command arguments as string. Note, that these will not get escaped!
180+
* `$args`: The command arguments as string. Note, that these will not get escaped. This
181+
will overwrite the args added with `addArgs()`.
180182
* `getArgs()`: The command arguments that where set through `setArgs()` or `addArg()`, as string
181183
* `addArg($key, $value=null, $escape=null)`: Add argument with correct escaping
182184
* `$key`: The argument key to add e.g. `--feature` or `--name=`. If the key does not end with
183-
and `=`, the `$value` will be separated by a space, if any. Keys are not escaped unless
184-
`$value` is null and `$escape` is `true`.
185-
* `$value`: The optional argument value which will get escaped if `$escapeArgs` is true.
185+
and `=`, the (optional) `$value` will be separated by a space. The key will get
186+
escaped if `$escapeArgs` is `true`.
187+
* `$value`: The optional argument value which will get escaped if `$escapeArgs` is `true`.
186188
An array can be passed to add more than one value for a key, e.g. `addArg('--exclude', array('val1','val2'))`
187189
which will create the option "--exclude 'val1' 'val2'".
188190
* `$escape`: If set, this overrides the `$escapeArgs` setting and enforces escaping/no escaping
189191
* `setStdIn()`: String or resource to supply to command via standard input.
192+
This enables the same functionality as piping on the command line. It can
193+
also be a resource like a file handle or a stream in which case its content
194+
will be piped into the command like an input redirection.
190195
* `getOutput()`: The command output as string. Empty if none.
191196
* `getError()`: The error message, either stderr or internal message. Empty if no error.
192197
* `getStdErr()`: The stderr output. Empty if none.
193-
* `getExitCode()`: The exit code.
198+
* `getExitCode()`: The exit code or `null` if command was not executed.
194199
* `getExecuted()`: Whether the command was successfully executed.
200+
* `getIsWindows()`: Whether we are on a Windows Owe are on a Windows OS
195201
* `execute()`: Executes the command and returns `true` on success, `false` otherwhise.
196202

197203
> **Note:** `getError()`, `getStdErr()` and `getOutput()` return the trimmed output.

src/Command.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ public function getArgs()
276276
/**
277277
* @param string $key the argument key to add e.g. `--feature` or
278278
* `--name=`. If the key does not end with `=`, the (optional) $value will
279-
* be separated by a space.
279+
* be separated by a space. The key will get escaped if `$escapeArgs` is `true`.
280280
* @param string|array|null $value the optional argument value which will
281281
* get escaped if $escapeArgs is true. An array can be passed to add more
282282
* than one value for a key, e.g.

0 commit comments

Comments
 (0)