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

Make command argument syntax sensitive for configuration #17

Closed
dominikbraun opened this issue May 15, 2021 · 1 comment
Closed

Make command argument syntax sensitive for configuration #17

dominikbraun opened this issue May 15, 2021 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@dominikbraun
Copy link
Owner

For example, the get record command has the following syntax:

timetrace/cli/get.go

Lines 53 to 56 in 16b10a9

getRecord := &cobra.Command{
Use: "record YYYY-MM-DD-HH-MM",
Short: "Display a record",
Args: cobra.ExactArgs(1),

Actually, YYYY-MM-DD-HH-MM is only the default syntax. If the user has set use12hours: true in their config, the expected format is YYYY-MM-DD-HH-MMPM instead, as you can see here:

timetrace/cli/get.go

Lines 58 to 62 in 16b10a9

layout := defaultRecordArgLayout
if t.Config().Use12Hours {
layout = "2006-01-02-03-04PM"
}

The Use field of the command should be changed accordingly, being sensitive to the actual configuration.

@dominikbraun dominikbraun added enhancement New feature or request good first issue Good for newcomers labels May 15, 2021
@dominikbraun
Copy link
Owner Author

Resolved by 54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant