Documentation
¶
Overview ¶
Package flags holds flag helpers shared by the milvus-backup subcommands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddRemoved ¶
AddRemoved registers removed flags so that an outdated command line still parses and CheckRemoved can answer it by naming the replacement, instead of cobra reporting a bare "unknown flag". They are hidden from help: they do nothing, and listing them beside the working flags would imply otherwise.
Types ¶
type Removed ¶
type Removed struct {
// Name is the flag as it was spelled while it still worked.
Name string
// Shorthand is its one-letter form, empty if it never had one.
Shorthand string
// NoValue marks a flag that took no argument, so that it is registered as a
// boolean and an old command line spelling it as a bare "--force" parses.
NoValue bool
// Advice completes the sentence "--name was removed in 0.6, ...".
Advice string
}
Removed is a flag that no longer has an implementation behind it. The 0.5 line still honored these and only logged a deprecation warning; 0.6 rejects them.
Keeping them registered is not what makes the rejection safe: cobra already fails on an unknown flag and exits non-zero, so all these stubs buy is the message naming the replacement. That is worth one release to whoever upgrades, and dropping them later degrades the message without letting anything through.
TODO: delete the removed-flag tables and this package in a release after 0.6.