From bb5ed452241c37ee9f2f3ebd02a2a5e1764334ad 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) --- pkg/mflag/flag.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/mflag/flag.go b/pkg/mflag/flag.go index b5c5fa9089..6fe3e41b23 100644 --- a/pkg/mflag/flag.go +++ b/pkg/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 }