Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add cli options #24

Closed
wants to merge 5 commits into from
Closed

add cli options #24

wants to merge 5 commits into from

Conversation

gballet
Copy link
Collaborator

@gballet gballet commented Feb 16, 2024

Demonstrate how options can be added easily added.

In order to see the help message, type:

> zig build run -- --help
steps [6/10] zig build-exe phant Debug native... LLVM Emit Object... info: Welcome to phant! 🐘
run

USAGE:
  run [OPTIONS]

OPTIONS:
      --network-id <VALUE>    network id
      --engine-port <VALUE>   port of the execution engine
  -h, --help                  Prints help information

@gballet gballet requested a review from jsign February 16, 2024 16:40
Copy link
Owner

@jsign jsign left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

build.zig Outdated
@@ -24,6 +24,8 @@ pub fn build(b: *std.Build) void {
.optimize = optimize,
});
const mod_httpz = httpz.module("httpz");
const zigcli_dep = b.dependency("zig-cli", .{ .target = target });
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

{ .optimize = optimize }?

build.zig.zon Outdated
@@ -14,5 +14,9 @@
.url = "https://github.com/karlseguin/http.zig/archive/1a82beb0dfc22e6fc38e9918e323f8fbd3cb78a3.tar.gz",
.hash = "122020cbd399273b1220f11c4b2d734b86c94cc5f1c2d6d90fc766580bc0e25b0dfb",
},
.@"zig-cli" = .{
.url = "https://github.com/sam701/zig-cli/archive/ddf49596a9225c91e6cd9c28904aec598d5becf0.tar.gz",
.hash = "1220787d26a153a3755d55c8b65af53f7b1c4d79add4a47e2898dc776f3a16f1ce89",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One less tab?


pub const Config = struct {
engine_port: u16 = 8551,
network_id: u64 = @intFromEnum(ChainId.Mainnet),
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Uhm, should we rename ChaindID enum to NetworkId?

@gballet gballet closed this Jun 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants