New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #14: Add args magic to provide cli-args to user program #27

Merged
merged 1 commit into from Apr 13, 2017

Conversation

Projects
None yet
2 participants
@spoorcc

spoorcc commented Apr 13, 2017

This PR fixes #14 by adding //% args as valid magic (case-insensitive) that can be used. It respects quotes as can be shown in code example below:

code

//% args: "one one" two "three \" three " four

#include <stdio.h>

int main( int argc, char *argv[] )  {
       
   for(int i=0; i < argc; i++)
   {
        printf("argv[%d]: >>%s<<\n", i, argv[i]);
   }
}

stdout

argv[0]: >>/tmp/tmpq_vq_wdr.out<<
argv[1]: >>one one<<
argv[2]: >>two<<
argv[3]: >>three \" three <<
argv[4]: >>four<<

@brendan-rius brendan-rius merged commit 628b776 into brendan-rius:master Apr 13, 2017

@brendan-rius

This comment has been minimized.

Owner

brendan-rius commented Apr 13, 2017

Thanks ! :)

@spoorcc spoorcc deleted the spoorcc:issue-14 branch Apr 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment