mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-31 20:00:09 +00:00
flags: Rename variadic to manifold (breaking change)
This commit is contained in:
@@ -30,8 +30,8 @@ write_usage :: proc(out: io.Writer, data_type: typeid, program: string = "", sty
|
||||
is_positional: bool,
|
||||
is_required: bool,
|
||||
is_boolean: bool,
|
||||
is_variadic: bool,
|
||||
variadic_length: int,
|
||||
is_manifold: bool,
|
||||
manifold_length: int,
|
||||
}
|
||||
|
||||
//
|
||||
@@ -120,10 +120,10 @@ write_usage :: proc(out: io.Writer, data_type: typeid, program: string = "", sty
|
||||
flag.is_required = true
|
||||
flag.required_min, flag.required_max, _ = parse_requirements(requirement)
|
||||
}
|
||||
if length_str, is_variadic := get_struct_subtag(args_tag, SUBTAG_VARIADIC); is_variadic {
|
||||
flag.is_variadic = true
|
||||
if length_str, is_manifold := get_struct_subtag(args_tag, SUBTAG_MANIFOLD); is_manifold {
|
||||
flag.is_manifold = true
|
||||
if length, parse_ok := strconv.parse_u64_of_base(length_str, 10); parse_ok {
|
||||
flag.variadic_length = cast(int)length
|
||||
flag.manifold_length = cast(int)length
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -147,15 +147,15 @@ write_usage :: proc(out: io.Writer, data_type: typeid, program: string = "", sty
|
||||
case runtime.Type_Info_Dynamic_Array:
|
||||
requirement_spec := describe_array_requirements(flag)
|
||||
|
||||
if flag.is_variadic || flag.name == INTERNAL_VARIADIC_FLAG {
|
||||
if flag.variadic_length == 0 {
|
||||
if flag.is_manifold || flag.name == INTERNAL_VARIADIC_FLAG {
|
||||
if flag.manifold_length == 0 {
|
||||
flag.type_description = fmt.tprintf("<%v, ...>%s",
|
||||
specific_type_info.elem.id,
|
||||
requirement_spec)
|
||||
} else {
|
||||
flag.type_description = fmt.tprintf("<%v, %i at once>%s",
|
||||
specific_type_info.elem.id,
|
||||
flag.variadic_length,
|
||||
flag.manifold_length,
|
||||
requirement_spec)
|
||||
}
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user