Skip to content

Instantly share code, notes, and snippets.

@jonaskgandersson
Created July 13, 2018 12:27
Show Gist options
  • Save jonaskgandersson/59f2c84a94c1ddac440e7083d9d59d01 to your computer and use it in GitHub Desktop.
Save jonaskgandersson/59f2c84a94c1ddac440e7083d9d59d01 to your computer and use it in GitHub Desktop.

Revisions

  1. jonaskgandersson created this gist Jul 13, 2018.
    32 changes: 32 additions & 0 deletions VS Code Task Arg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,32 @@
    https://stackoverflow.com/questions/45582698/is-it-possible-to-pass-arguments-to-a-task-in-visual-studio-code

    {
    "label": "runwithargs",
    "type": "shell",
    "windows": {
    "options": {
    "shell": {
    "executable": "powershell.exe",
    "args": [
    "-NoProfile",
    "-ExecutionPolicy",
    "Bypass",
    "-Command"
    ]
    }
    },
    "command": "",
    "args": [
    { "value": "$cmdargs = read-host 'Enter command line arguments';", "quoting": "weak"},
    { "value": "go run ${file} $cmdargs", "quoting": "weak"}
    ]
    },
    /*"linux": {
    "command": "echo 'Enter command line arguments: '; read cmdargs;",
    "args": [ "go run ${file} $cmdargs" ]
    },*/
    "presentation": {
    "panel": "dedicated",
    "focus": true
    }
    }