#571·kong

Deprecation of arguments and sub-commands

Author: dlinn89Created Jan 13, 2026Updated Mar 6, 2026

First of all: Kong is a really nice and easy to use tool, and appreciate the work put into it. A big shoutout to all maintainers and contributors ❤️

Now to my question: As software services evolve, some arguments and/or subcommands may no longer be necessary or not even supported anymore.

Consider the following minimal example:

go
package main

import (
	"fmt"

	"github.com/alecthomas/kong"
)

type Config struct {
	Foo struct {
		A int `name:"a" default:"1"`
		_ int `name:"b" default:"1"`
	} `embed:"" prefix:"foo."`
}

func main() {
	config := new(Config)
	_ = kong.Parse(
		config,
		kong.UsageOnError(),
	)
	fmt.Println(config)
} 

In this example I no longer wish to support the foo.b option. Calling the application with foo.b=1337 terminates the application, since the value has no well defined destination to go to. I know that I could add an annotation kong:"-" or use the IgnoreFields option prevent this, but as I understand this is intended for non-CLI fields, whereas I wish to explicitly communicate that this previously valid option is no longer supported. Is there any idiomatic way to express deprecation of formerly valid arguments with kong which I may have overlooked, or would this be a new feature?

Thank you already for looking into it!