Skip to content

The os.Args input shouldn't avoid the argv[0] #238

@purpleidea

Description

@purpleidea

For the v2/ API, I recommend we accept the full os.Args list, rather than taking off the zeroth argument. Most of the API's out there assume you're passing in the zeroth arg, and I don't know why we should be different.

Furthermore, it would be excellent if the library would actually parse out the zeroth arg. For example, in your top-level args struct, you could do:

type Args struct {
	// XXX: We cannot have both subcommands and a positional argument.
	// XXX: I think it's a bug of this library that it can't handle argv[0].
	Argv0 string `arg:"zeroth"` // some special tag could let it know where to put it

or similar, so that we extract this value correctly.

This changes the behaviour, so I recommend it happen for v2.

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions