Search code examples
flutterdartcommand-line-interfacenano

dart:cli start nano command and parse than the content


👋🏼 hallo guys,

i want to write a cli dart app. which starts nano .... and at exit save the input should be parsed to a File(...) as content.

i already tried to look for something like this on the pub.dev site, but couldn't find anything. maybe i'm looking for it wrong ... ?

for example:

var output = *start nano*

var file = File(argResults!['file-name']).writeAsStringSync(output);

how can i do that?


Solution

  • Have a look at the 'editor' function in the dcli package.

    https://onepub.dev/packages/dcli

    It starts an editor and waits for it to close.