const std = @import("std"); const builtin = @import("builtin"); const build_options = @import("build_options"); const cli = @import("zig-cli"); const options = @import("options.zig"); const connect = @import("connect.zig"); const update = @import("update.zig"); pub fn main() !void { var gpa = std.heap.GeneralPurposeAllocator(.{}){}; const alloc = gpa.allocator(); options.options.alloc = alloc; var r = try cli.AppRunner.init(alloc); const app = cli.App{ .command = cli.Command{ .name = "hostapps", .description = cli.Description{ .one_line = "hostapps", }, .target = cli.CommandTarget{ .subcommands = &.{ cli.Command{ .name = "connect", .description = cli.Description{ .one_line = "connect", }, .options = &.{ cli.Option{ .long_name = "config", .help = "config file", .value_ref = r.mkRef(&options.options.config), .required = true, }, cli.Option{ .long_name = "identity", .help = "ssh identity", .value_ref = r.mkRef(&options.options.identities), }, cli.Option{ .long_name = "proxy-jump", .help = "proxy jump", .value_ref = r.mkRef(&options.options.proxy_jump), }, cli.Option{ .long_name = "ssh-command", .help = "ssh command", .value_ref = r.mkRef(&options.options.ssh_path), }, cli.Option{ .long_name = "telnet-command", .help = "telnet command", .value_ref = r.mkRef(&options.options.telnet_path), }, }, .target = cli.CommandTarget{ .action = cli.CommandAction{ .exec = connect.connect, }, }, }, cli.Command{ .name = "update", .description = cli.Description{ .one_line = "update", }, .options = &.{}, .target = cli.CommandTarget{ .action = cli.CommandAction{ .exec = update.update, }, }, }, }, }, }, .version = "0.1.0", .author = "Jeffrey C. Ollie ", }; return r.run(&app); }