dominikbraun / timetrace

A simple CLI for tracking your working time.
Apache License 2.0
679 stars 75 forks source link

Simplify record keys #131

Closed FelixTheodor closed 2 years ago

FelixTheodor commented 3 years ago

closes #116

I implemented the features discussed in #116, but I needed to change the "marker" of the ID from # to *. Otherwise, the argument seems to be ignored. I don't know if it's my terminal or the go library or something else, but the arg[0] is empty when the input starts with a #. This begs two questions: Are you okay with the * as a marker, or would you prefer something else? And should we change the header of the list record command accordingly, to avoid confusion?

dominikbraun commented 3 years ago

I implemented the features discussed in #116, but I needed to change the "marker" of the ID from # to *. Otherwise, the argument seems to be ignored. I don't know if it's my terminal or the go library or something else, but the arg[0] is empty when the input starts with a #.

Ah, yes, because # introduces a shell comment just like // introduces a code comment. I didn't have that in mind. * is not too bad, ! or $ would work out as well... What would @joshuaherrera, @KonstantinGasser and @aligator prefer? 😛

KonstantinGasser commented 3 years ago

I am not sure if $ would work? $ indicates a variable in shell right? At least on iTerm the timetrace edit record $1 returns an accepts 1 arg(s), received 0. Personally I can image that the @ would work good too.

joshuaherrera commented 3 years ago

I implemented the features discussed in #116, but I needed to change the "marker" of the ID from # to *. Otherwise, the argument seems to be ignored. I don't know if it's my terminal or the go library or something else, but the arg[0] is empty when the input starts with a #.

Ah, yes, because # introduces a shell comment just like // introduces a code comment. I didn't have that in mind. * is not too bad, ! or $ would work out as well... What would @joshuaherrera, @KonstantinGasser and @aligator prefer?

I think the * symbol should work fine, I use bash for my terminal and ! is used for history expansion and $ usually refers to a variable, so I think there may be unexpected consequences with those symbols.

joshuaherrera commented 3 years ago

I am not sure if $ would work? $ indicates a variable in shell right? At least on iTerm the timetrace edit record $1 returns an accepts 1 arg(s), received 0. Personally I can image that the @ would work good too.

I like the @ symbol as well, it seems to make the most sense in the context of this command.

dominikbraun commented 3 years ago

@KonstantinGasser @joshuaherrera Not sure what was going through my mind when suggesting $ as part of a command syntax 🤣 You're right, @ would be a nice fit. Can we make sure there are no collisions with modules, which are indicated by an @ as well? If yes, I might even prefer @ over *.

aligator commented 3 years ago

* is treated in some shells as wildcard and some completion tools may replace it with all paths of the current folder... (didn't try that out but who knows what happens....)

So I would also suggest @. In fact the @ is also used for example in systemd to pass params to a service file. systemctl start wg-quick@wg0 So it should work here too.

FelixTheodor commented 3 years ago

Thanks for all the feedback! I also think that @ is the best solution, therefore I changed it :)

dominikbraun commented 2 years ago

Sorry for the delay - this is going to be merged now!