Comment on page
DCli works very hard to ensure that you don't need to worry about Futures.
This is very intentional.
If you stick to using DCli's built in functions then you can completely ignore Futures. If you start importing Dart's core libraries or third party libraries then you need to pay attention to return types.
The first time you try to call a method or function that returns a
Futurethen you will know its time to come back here and read about Futures.
Until then, you can just skip this section.
DCli does not stop you from using
Isolatesor any other Dart functionality. It's all yours to use and abuse as you will.
DClis global functions however intentionally avoid
The aim of DCli is to create a Bash-like simplicity to building CLI apps.
Futuresare great and all but they do make the code more complex and harder to read.
Futures also can make your scripts a little dangerous. If you copy a file and then want to append to the copied file, you had better be certain that the copy command has been completed before you start the append. DCli's global functions remove those complications.
If you are interested in how we avoid using
Futuresread up on
waitForand check out DCli's own
waitForExfunction that does stacktrace repair when an exception is thrown.
When you need to use futures you can read up on them in the Dart language Tour: