diff options
| author | 2018-05-31 13:28:26 +0200 | |
|---|---|---|
| committer | 2018-05-31 13:28:26 +0200 | |
| commit | f3bacd8d6543851d20862c3129b566d1bcaf8d3d (patch) | |
| tree | a118ce008af64d6d45453e1be2678568aeaf99ba /index.zig | |
| parent | Support for basic sub commands (diff) | |
| download | zig-clap-f3bacd8d6543851d20862c3129b566d1bcaf8d3d.tar.gz zig-clap-f3bacd8d6543851d20862c3129b566d1bcaf8d3d.tar.xz zig-clap-f3bacd8d6543851d20862c3129b566d1bcaf8d3d.zip | |
Reworked the core.
Diffstat (limited to 'index.zig')
| -rw-r--r-- | index.zig | 14 |
1 files changed, 7 insertions, 7 deletions
| @@ -128,10 +128,12 @@ pub const Command = struct { | |||
| 128 | const id = i; | 128 | const id = i; |
| 129 | res[id] = core.Param(usize) { | 129 | res[id] = core.Param(usize) { |
| 130 | .id = id, | 130 | .id = id, |
| 131 | .command = null, | ||
| 132 | .short = p.short, | ||
| 133 | .long = p.long, | ||
| 134 | .takes_value = p.takes_value != null, | 131 | .takes_value = p.takes_value != null, |
| 132 | .names = core.Names{ | ||
| 133 | .bare = null, | ||
| 134 | .short = p.short, | ||
| 135 | .long = p.long, | ||
| 136 | }, | ||
| 135 | }; | 137 | }; |
| 136 | } | 138 | } |
| 137 | 139 | ||
| @@ -139,10 +141,8 @@ pub const Command = struct { | |||
| 139 | const id = i + command.params.len; | 141 | const id = i + command.params.len; |
| 140 | res[id] = core.Param(usize) { | 142 | res[id] = core.Param(usize) { |
| 141 | .id = id, | 143 | .id = id, |
| 142 | .command = c.name, | ||
| 143 | .short = null, | ||
| 144 | .long = null, | ||
| 145 | .takes_value = false, | 144 | .takes_value = false, |
| 145 | .names = core.Names.bare(c.name), | ||
| 146 | }; | 146 | }; |
| 147 | } | 147 | } |
| 148 | 148 | ||
| @@ -159,7 +159,7 @@ pub const Command = struct { | |||
| 159 | }; | 159 | }; |
| 160 | 160 | ||
| 161 | var pos: usize = 0; | 161 | var pos: usize = 0; |
| 162 | var iter = core.Iterator(usize).init(core_params, arg_iter, allocator); | 162 | var iter = core.Clap(usize).init(core_params, arg_iter, allocator); |
| 163 | defer iter.deinit(); | 163 | defer iter.deinit(); |
| 164 | 164 | ||
| 165 | arg_loop: | 165 | arg_loop: |