gonuit / rps

Define and use scripts from your pubspec.yaml file.
MIT License
44 stars 8 forks source link

Quoted arguments get splitted #21

Closed martin-braun closed 3 months ago

martin-braun commented 4 months ago

A script of mine launches a dart program:

scripts:
  screenshots: fvm dart flutter_screenshots.dart

Now I wish to call it like this:

rps screenshots "iPhone Xs Max"

However, the args are messed up:

Future<void> main(List<String> args) async {
    print("###" + args[0]); // prints only "###iPhone"
}

args[1] contains "Xs" and so on. So passing arguments with quotes does not work. Interestingly though, having those quotes embedded in the script call works:

scripts:
  screenshots: fvm dart flutter_screenshots.dart "iPhone Xs Max"

This works just fine. The argument parser seems to not account for spaces in quotes.

martin-braun commented 3 months ago

@gonuit 0.8.1, I haven't touched the project since then. If you cannot reproduce, maybe something in between messes up my args, but it's no issue for any other environment / scenario.

I'm launching my scripts from a tmux session running in WezTerm on macOS, could this be related?

gonuit commented 3 months ago

Hi @martin-braun, I managed to find the bug. The fix is available in version 0.8.2 and you can test it :)