summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md24
1 files changed, 7 insertions, 17 deletions
diff --git a/README.md b/README.md
index c959009..511087d 100644
--- a/README.md
+++ b/README.md
@@ -25,9 +25,7 @@ const clap = @import("clap");
25const debug = std.debug; 25const debug = std.debug;
26 26
27pub fn main() !void { 27pub fn main() !void {
28 var direct_allocator = std.heap.DirectAllocator.init(); 28 const allocator = std.heap.direct_allocator;
29 const allocator = &direct_allocator.allocator;
30 defer direct_allocator.deinit();
31 29
32 // First we specify what parameters our program can take. 30 // First we specify what parameters our program can take.
33 const params = [_]clap.Param(u8){ 31 const params = [_]clap.Param(u8){
@@ -90,13 +88,7 @@ const clap = @import("clap");
90const debug = std.debug; 88const debug = std.debug;
91 89
92pub fn main() !void { 90pub fn main() !void {
93 const stdout_file = try std.io.getStdOut(); 91 const allocator = std.heap.direct_allocator;
94 var stdout_out_stream = stdout_file.outStream();
95 const stdout = &stdout_out_stream.stream;
96
97 var direct_allocator = std.heap.DirectAllocator.init();
98 const allocator = &direct_allocator.allocator;
99 defer direct_allocator.deinit();
100 92
101 // First we specify what parameters our program can take. 93 // First we specify what parameters our program can take.
102 const params = [_]clap.Param([]const u8){ 94 const params = [_]clap.Param([]const u8){
@@ -146,11 +138,9 @@ const std = @import("std");
146const clap = @import("clap"); 138const clap = @import("clap");
147 139
148pub fn main() !void { 140pub fn main() !void {
149 const params = [_]clap.Param(void){ 141 const params = [_]clap.Param(void){clap.Param(void){
150 clap.Param(void){ 142 .names = clap.Names{ .short = 'h', .long = "help" },
151 .names = clap.Names{ .short = 'h', .long = "help" } 143 }};
152 },
153 };
154 144
155 var direct_allocator = std.heap.DirectAllocator.init(); 145 var direct_allocator = std.heap.DirectAllocator.init();
156 const allocator = &direct_allocator.allocator; 146 const allocator = &direct_allocator.allocator;
@@ -204,11 +194,11 @@ pub fn main() !void {
204 [_]clap.Param([]const u8){ 194 [_]clap.Param([]const u8){
205 clap.Param([]const u8){ 195 clap.Param([]const u8){
206 .id = "Display this help and exit.", 196 .id = "Display this help and exit.",
207 .names = clap.Names{ .short = 'h', .long = "help" } 197 .names = clap.Names{ .short = 'h', .long = "help" },
208 }, 198 },
209 clap.Param([]const u8){ 199 clap.Param([]const u8){
210 .id = "Output version information and exit.", 200 .id = "Output version information and exit.",
211 .names = clap.Names{ .short = 'v', .long = "version" } 201 .names = clap.Names{ .short = 'v', .long = "version" },
212 }, 202 },
213 }, 203 },
214 ); 204 );