Git Product home page Git Product logo

accord's Introduction

accord's People

Contributors

banchouboo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

iddev5

accord's Issues

Default example not compiling in Zig 0.9.1

Hello, thank you for the cool lib!

I was just testing some arguments to parse an ip + port when I run my main, but I couldn't manage to compile. I get the same results with the example code.

    const allocator = std.heap.page_allocator;
    var args_iterator = std.process.args();
    const options = try accord.parse(&.{
        accord.option('s', "string", []const u8, "default", .{}),
        // accord.option('i', "ip", []const u8, "127.0.0.1", .{}),
        // accord.option('p', "port", []const u8, "10002", .{}),
    }, allocator, &args_iterator);
    defer options.positionals.deinit(allocator);

Console logs:

xxxxxxx@xxxxxxx destral_zig % zig build
./src/accord/accord.zig:146:18: error: default_value of field 'string' is of type '?*const []const u8', expected '[]const u8' or '?[]const u8'
    return @Type(struct_info);
                 ^
./src/accord/accord.zig:231:114: note: called from here
pub fn parse(comptime options: []const Option, allocator: std.mem.Allocator, arg_iterator: anytype) !OptionStruct(options) {
                                                                                                                 ^
./src/accord/accord.zig:231:114: note: called from here
pub fn parse(comptime options: []const Option, allocator: std.mem.Allocator, arg_iterator: anytype) !OptionStruct(options) {
                                                                                                                 ^
./src/main.zig:526:29: note: called from here
pub fn main() anyerror!void {
                            ^
zig_destral...The following command exited with error code 1:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.