From ed2e85ad249feb2cf6426665b1601b937f9fcc1a Mon Sep 17 00:00:00 2001 From: Victor Vieux Date: Mon, 3 Mar 2014 19:57:05 +0000 Subject: [PATCH] add warning for deprecatd flags Docker-DCO-1.1-Signed-off-by: Victor Vieux (github: vieux) --- mflag/flag.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mflag/flag.go b/mflag/flag.go index b5c5fa9..6fe3e41 100644 --- a/mflag/flag.go +++ b/mflag/flag.go @@ -803,6 +803,11 @@ func (f *FlagSet) parseOne() (bool, string, error) { f.actual = make(map[string]*Flag) } f.actual[name] = flag + for _, n := range flag.Names { + if n == fmt.Sprintf("#%s", name) { + fmt.Fprintf(f.out(), "Warning: '-%s' is deprecated, it will be removed soon. See usage.\n", name) + } + } return true, "", nil }