Merge cli flag modules in vlib to one #11752
Replies: 9 comments 2 replies
-
Hi, I think before going forward, we need to be clear on what we want. There has been discussion on discord with several contributor and here is the points were we seems to have found some sort of consensus :
percent := git.get_float(cli.Flaf{
name: 'percent'
type_name: 'percent'
flag: .custom,
validator: fn (value string) ?f64 {
f_val := value.f64()
if f_val >= 0 && f_val <= 100 { return f_val
} else { return error('Must be between 0 and 100')
}
}
})
If I come up with other thing, I will edit this message. What do you think about that ? |
Beta Was this translation helpful? Give feedback.
-
Can i suggest using the standard "--" and not "-" for multi char arguments. |
Beta Was this translation helpful? Give feedback.
-
Using -- is a GNU standard, and has only existed as a "standard" since 1990. POSIX and many others that have existed for much longer (since the 1960s) only use - for all options, no matter the length. |
Beta Was this translation helpful? Give feedback.
-
To me follwing the newer standard makes more sense. :) |
Beta Was this translation helpful? Give feedback.
-
Newer is not always better. And GNU is only 2 years newer than POSIX (1988), so not enough difference to matter. |
Beta Was this translation helpful? Give feedback.
-
Are there any arguments that one dash is better than two? Obviously most tools use two dashes and it's cleaner (to me). |
Beta Was this translation helpful? Give feedback.
-
Yes, most GNU tools, but not most tools. Many common tools that come preinstalled only use single dash long options, like The ONLY time it is useful to use two dashes is if there are short options with the same first letter as a long option... assuming there are any short options at all. If not, it's just an extra character to type. |
Beta Was this translation helpful? Give feedback.
-
Whats the take on this, no input since 2021 ? |
Beta Was this translation helpful? Give feedback.
-
+1 for |
Beta Was this translation helpful? Give feedback.
-
We have
flag
,cli
andos.cmdline
. All of them should be merged to one module.https://discord.com/channels/592103645835821068/592320321995014154/789781987338485781
Beta Was this translation helpful? Give feedback.
All reactions