Last active
December 15, 2015 10:29
-
-
Save kblomqvist/5246221 to your computer and use it in GitHub Desktop.
Brainstorming the look of docopt.c struct
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef struct { | |
/* flag options */ | |
int h; | |
int help; | |
int moored; | |
int version; | |
/* options with arguments */ | |
char *speed; | |
/* positional arguments */ | |
char *name; | |
char *x; | |
char *y; | |
/* commands */ | |
int ship; | |
int mine; | |
/* subcommands */ | |
int move; | |
int new; | |
int remove; | |
int set; | |
int shoot; | |
/* special */ | |
char *usage; | |
char *help; | |
int error; | |
} DocoptArgs; | |
typedef struct { | |
/* flag options */ | |
int _h; | |
int __help; | |
int __moored; | |
int __version; | |
/* options with arguments */ | |
char *__speed; | |
/* positional arguments */ | |
char *NAME; | |
char *X; | |
char *Y; | |
/* commands */ | |
int ship; | |
int mine; | |
/* subcommands */ | |
int move; | |
int new; | |
int remove; | |
int set; | |
int shoot; | |
/* special */ | |
char *usage; | |
char *help; | |
int error; | |
} DocoptArgs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"--drifting": false, | |
"--help": false, | |
"--moored": false, | |
"--speed": "20", | |
"--version": false, | |
"<name>": ["Guardian"], | |
"<x>": "10", | |
"<y>": "50", | |
"mine": false, | |
"move": true, | |
"new": false, | |
"remove": false, | |
"set": false, | |
"ship": true, | |
"shoot": false} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment