From 2f591fc02faf0c8b6c770f68b417b63e586640a6 Mon Sep 17 00:00:00 2001 From: torque Date: Sat, 1 Apr 2023 13:05:09 -0700 Subject: [PATCH] command: remove exposed option This wasn't fully implemented, and I don't actually think there's a real reason for it to exist. It was cargo culted over from my own thinking about click functionality, but API differences mean it just isn't really useful here. --- source/command.zig | 2 -- source/parameters.zig | 5 ----- 2 files changed, 7 deletions(-) diff --git a/source/command.zig b/source/command.zig index c95b754..f05bde8 100644 --- a/source/command.zig +++ b/source/command.zig @@ -178,7 +178,6 @@ pub fn CommandBuilder(comptime UserContext: type) type { .required = config.required, .global = config.global, // - .exposed = config.exposed, .secret = config.secret, .nice_type_name = "flag", }; @@ -277,7 +276,6 @@ pub fn CommandBuilder(comptime UserContext: type) type { .alignment = 0, }}; - if (!param.exposed) continue :paramloop; while (flag_skip > 0) { flag_skip -= 1; continue :paramloop; diff --git a/source/parameters.zig b/source/parameters.zig index ac10334..96415c6 100644 --- a/source/parameters.zig +++ b/source/parameters.zig @@ -148,7 +148,6 @@ pub fn OptionConfig(comptime generics: ParameterGenerics) type { required: bool = generics.param_type == .Ordinal, global: bool = false, - exposed: bool = true, secret: bool = false, nice_type_name: []const u8 = @typeName(generics.OutputType), flag_bias: FlagBias = .unbiased, @@ -176,7 +175,6 @@ pub fn FlagConfig(comptime generics: ParameterGenerics) type { required: bool = false, global: bool = false, - exposed: bool = true, secret: bool = false, }; } @@ -212,7 +210,6 @@ fn OptionType(comptime generics: ParameterGenerics) type { /// if false, do not expose the resulting value in the output type. /// the converter must have side effects for this option to do anything. - exposed: bool, /// do not print help for this parameter secret: bool, @@ -278,7 +275,6 @@ pub fn make_option(comptime generics: ParameterGenerics, comptime opts: OptionCo .required = opts.required, .global = opts.global, // - .exposed = opts.exposed, .secret = opts.secret, .nice_type_name = opts.nice_type_name, .flag_bias = opts.flag_bias, @@ -320,7 +316,6 @@ pub fn make_argument( .required = opts.required, .global = opts.global, // - .exposed = opts.exposed, .secret = opts.secret, .nice_type_name = opts.nice_type_name, .flag_bias = .unbiased,