Skip to content

Commit e5c32f7

Browse files
committed
[docopt_c/_data/docopt{.h,.c}] Regenerate; [docopt_c/_data/example.c] Simplify example (slightly); [docopt_c/_data/test_docopt.c] size_t -> int; EXIT_SUCCESS and EXIT_FAILURE ; [README.md] Use latest example; [docopt_c/__init__.py] Match version to one in example
1 parent 0251162 commit e5c32f7

File tree

6 files changed

+347
-245
lines changed

6 files changed

+347
-245
lines changed

README.md

+21-22
Original file line numberDiff line numberDiff line change
@@ -43,31 +43,30 @@ $ cat example.docopt | python -m docopt_c > docopt.c
4343
### Step 3. Include the generated `docopt.c` into your program
4444

4545
```c
46-
#include <stdlib.h>
47-
#include "docopt.c"
46+
#include "docopt.h"
4847

4948
int main(int argc, char *argv[])
5049
{
51-
DocoptArgs args = docopt(argc, argv, /* help */ 1, /* version */ "2.0rc2");
52-
53-
printf("Commands\n");
54-
printf(" mine == %s\n", args.mine ? "true" : "false");
55-
printf(" move == %s\n", args.move ? "true" : "false");
56-
printf(" create == %s\n", args.create ? "true" : "false");
57-
printf(" remove == %s\n", args.remove ? "true" : "false");
58-
printf(" set == %s\n", args.set ? "true" : "false");
59-
printf(" ship == %s\n", args.ship ? "true" : "false");
60-
printf(" shoot == %s\n", args.shoot ? "true" : "false");
61-
printf("Arguments\n");
62-
printf(" x == %s\n", args.x);
63-
printf(" y == %s\n", args.y);
64-
printf("Flags\n");
65-
printf(" --drifting == %s\n", args.drifting ? "true" : "false");
66-
printf(" --help == %s\n", args.help ? "true" : "false");
67-
printf(" --moored == %s\n", args.moored ? "true" : "false");
68-
printf(" --version == %s\n", args.version ? "true" : "false");
69-
printf("Options\n");
70-
printf(" --speed == %s\n", args.speed);
50+
struct DocoptArgs args = docopt(argc, argv, /* help */ 1, /* version */ "2.0rc2");
51+
52+
puts("Commands");
53+
printf("\tmine == %s\n", args.mine ? "true" : "false");
54+
printf("\tmove == %s\n", args.move ? "true" : "false");
55+
printf("\tcreate == %s\n", args.create ? "true" : "false");
56+
printf("\tremove == %s\n", args.remove ? "true" : "false");
57+
printf("\tset == %s\n", args.set ? "true" : "false");
58+
printf("\tship == %s\n", args.ship ? "true" : "false");
59+
printf("\tshoot == %s\n", args.shoot ? "true" : "false");
60+
puts("Arguments");
61+
printf("\tx == %s\n", args.x);
62+
printf("\ty == %s\n", args.y);
63+
puts("Flags");
64+
printf("\t--drifting == %s\n", args.drifting ? "true" : "false");
65+
printf("\t--help == %s\n", args.help ? "true" : "false");
66+
printf("\t--moored == %s\n", args.moored ? "true" : "false");
67+
printf("\t--version == %s\n", args.version ? "true" : "false");
68+
puts("Options");
69+
printf("\t--speed == %s\n", args.speed);
7170

7271
return EXIT_SUCCESS;
7372
}

docopt_c/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

33
__author__ = "Vladimir Keleshev"
4-
__version__ = "0.0.3"
4+
__version__ = "2.0.0-rc2"
55
__description__ = "C generator for language for description of command-line interfaces"

0 commit comments

Comments
 (0)