Initial release cleanup.
This commit is contained in:
parent
89b7769e1e
commit
334f34d84d
5 changed files with 47 additions and 13 deletions
10
README.md
10
README.md
|
@ -50,6 +50,10 @@ dart compile exe bin/dcat.dart
|
|||
```
|
||||
|
||||
## Library Usage
|
||||
```sh
|
||||
dart pub add dcat
|
||||
```
|
||||
|
||||
```dart
|
||||
import 'package:dcat/dcat.dart';
|
||||
|
||||
|
@ -88,10 +92,12 @@ A `CatResult` object is returned which contains the `exitCode` (`exitSuccess` or
|
|||
final result =
|
||||
await cat(['path/to/file'], stdout, showLineNumbers: true);
|
||||
if (result.exitCode == exitSuccess) { // or result.isSuccess
|
||||
...
|
||||
// ...
|
||||
} else {
|
||||
for (final error in result.errors) {
|
||||
stderr.writeln("Error with '${error.path}': ${error.message}");
|
||||
}
|
||||
}
|
||||
```
|
||||
```
|
||||
|
||||
[View Full Example](https://github.com/ethauvin/dcat/blob/master/example/example.dart)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue