onepub-dev / dcli

An extensive library and tooling for building console/cli applications and scripts using the Dart programming language.
236 stars 26 forks source link

How do I even use `find`?! #228

Closed Ahmadre closed 4 months ago

Ahmadre commented 4 months ago

At first thank you so much for this awesome package 💯

But I can't find any up to date docs on how to retreive the current dart files I try to iterate through :/ ...

import 'dart:io';

import 'package:dcli_core/dcli_core.dart';

Future<void> main() async {
  final LimitedStreamController<FindItem> progress =
      LimitedStreamController<FindItem>(1)..onListen = () => stdout;

  /// 1. Get all files which uses `xyz` AND imports us

  final dartFiles = find(
    '*.dart',
    progress: progress,
    types: [Find.file],
  );

  progress.close();
}

find is of type Future<void>?! How do I even filter or get the dartfiles?

I'm really confused...and I never used progress and doesn't see any docs here... can you please show me where to find any infos? Maybe I'm blind ^^