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

Use server's timestamp.ParseDuration for all durations #572

Merged
merged 2 commits into from
May 21, 2024

Conversation

dnr
Copy link
Member

@dnr dnr commented May 20, 2024

What was changed

Use server timestamp.ParseDuration for parsing durations in flags. This supports a d suffix for multiples of 24 hours.

Why?

Convenience and compatibility.

Checklist

  1. How was this tested:
    Modified namespace test and checked --help output manually

@@ -335,6 +336,10 @@ func (c *CommandOption) writeFlagBuilding(selfVar, flagVar string, w *codeWriter
desc += fmt.Sprintf(" Accepted values: %s.", strings.Join(c.EnumValues, ", "))
}

if setDefault != "" {
// set default before calling Var so that it stores thedefault value into the flag
w.writeLinef("%v.%v = %v", selfVar, c.fieldName(), setDefault)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cretz If this isn't the right way to do defaults for Var flags, let me know

@dnr dnr merged commit 4255cc0 into temporalio:main May 21, 2024
7 checks passed
@dnr dnr deleted the duration branch May 21, 2024 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants