Cargo tasks from VSCODE (run)

Is there a way to specify arguments to a RUST cargo command running as VSCODE task?
Or should I be trying this as an NPM script? (but why should I be even using NPM scripts, with Rust we have Cargo, not package.json scripts).

The Build task works fine:

    "version": "2.0.0",
    "tasks": [
        {
            "type": "cargo",
            "subcommand": "build",
            "problemMatcher": [
                "$rustc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            }
        },

But I have no idea where to put the arguments, since I want it to be

$cargo run [filename]

        {
            "type": "cargo",
            "subcommand": "run",
            "problemMatcher": [
                "$rustc"
            ]
        }

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.