Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TimeFlag #696

Closed
LeonB opened this issue Dec 29, 2017 · 5 comments · Fixed by #987
Closed

TimeFlag #696

LeonB opened this issue Dec 29, 2017 · 5 comments · Fixed by #987
Labels
kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start

Comments

@LeonB
Copy link

LeonB commented Dec 29, 2017

I'd like to add a cli.TimeFlag. Is this something that would be accepted as a pull request?

Also, I would like to be able to specify the format of the time in the flag.

cli.TimeFlag{
	Name:  "date",
	Usage: "date",
	Format: "2016-01-02",
}

However, I can't specify an extra field flag-types.json. Should I create custom flag type in flag.go or should I add the possibility of adding extra fields in generate-flag-types?

@jszwedko
Copy link
Contributor

Hi @LeonB,

I'd welcome the addition of a TimeFlag with a format specifier. I think we could modify the schema in flag-types.json to allow the specification of additional struct fields. To make it agnostic, we could just do something like:

    {
      "name": "TimeFlag",
      "type": "time.Time",
      "context_default": "nil",
      "extra_fields": {
           "Format": "string",
       },
    }

What do you think?

Curious if you have any thoughts on that @meatballhat

@meatballhat
Copy link
Member

@jszwedko I agree with you! 💖

@cgebe
Copy link

cgebe commented Jan 19, 2018

Would also welcome this feature!

@LeonB
Copy link
Author

LeonB commented Jan 31, 2018

I don't know if the timeflag can be added because of the dependency on flag.FlagSet which doesn't support time flags.

@meatballhat meatballhat self-assigned this Feb 25, 2018
@coilysiren coilysiren added kind/feature describes a code enhancement / feature request help wanted please help if you can! status/confirmed confirmed to be valid, but work has yet to start labels Aug 9, 2019
@coilysiren coilysiren removed the help wanted please help if you can! label Aug 17, 2019
@coilysiren
Copy link
Member

Given that this is from last year, I think I'm comfortable closing it 🙂 feel free to re-open / open a new issue / comment in support if there's still interest here!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature describes a code enhancement / feature request status/confirmed confirmed to be valid, but work has yet to start
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants