dog is a rewrite of the cat
utility in dart, written for learning purposes.
Wanted to learn about building CLIs using dart.
Before you begin, ensure you have met the following requirements:
- You have installed the latest version of
dart
To get dog, follow these steps:
git clone https://github.com/2kabhishek/dog
cd dog
flutter pub get
dart run bin/dog.dart -n README.md
USAGE:
dog [-nh] [path]
FLAGS:
-h, --help Prints help information.
-n, --line-number Prints file at $path with line numbers.
OPTIONS:
path File to print using dog.
Example:
dog -n README.md
dog was built using dart
and code
.
While building dog the main challenges were learning about dart conventions and the dart
way of doing things.
final
vsconst
keywords -final
should be used when we do not know the value at compile time -const
should be used when we know values at compile time- Using
Future
for long running task - Using
Platform.environment
for fetching env values - Null checks and the
??
null aware operator - Reading args using
ArgParser
- Setting exitCodes using
exitCode
- Exception handling
- Managing packages with pub
- Dart tooling in general
Hit the β button if you found this useful.