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

Update fish completions #295

Merged
merged 6 commits into from
Jul 15, 2019

Conversation

andrewmeyer
Copy link
Contributor

@andrewmeyer andrewmeyer commented Jul 9, 2019

Update the fish completions profile to support newly added commands.
Some unseen work was also done: notably organizing the ungrouped commands.
Adds support for new features:

  • limit to lunar cycles
  • support csv output

Completions Added

Completions Extended

Tests Ran:

  • tests were ran against the current master position: 30313be
  • Due to the nature of completion profiles, proof of testing can be tricky, I encourage another fish user to vet these additions as well.

add

chimera  ~/  watson add --from 2019-07-04-00:00 --to 2019-07-04-23:00 "take the day off"
Adding project take the day off, started 4 days ago and stopped 4 days ago. (id: c9874b9)

chimera  ~/  watson add --from 2019-07-04-00:00 --to 2019-07-04-23:00 "take the day off" +test
Adding project take the day off [test], started 4 days ago and stopped 4 days ago. (id: b163455)

chimera  ~/  watson add --from 2019-07-04-00:00 --to 2019-07-04-23:00 "take the day off" +test2 --confirm-new-tag 
Tag 'test2' does not exist yet. Create it? [y/N]: y
Adding project take the day off [test2], started 4 days ago and stopped 4 days ago. (id: 7411689)

chimera  ~/  watson remove 7411689
You are about to remove frame take the day off [test2] from 00:00 to 00:00, continue? [y/N]: y
Frame removed

chimera  ~/  watson remove b163455
You are about to remove frame take the day off [test] from 00:00 to 00:00, continue? [y/N]: y
Frame removed.
  • we see here that I didn't understand how to properly enter my time, this may need to be clarified in the docs, not unlike watson stop --at. That is out of scope for this particular PR though.

aggregate

chimera  ~/  watson aggregate --project "take the day off" -G
Mon 01 July 2019 - 00s


Tue 02 July 2019 - 00s


Wed 03 July 2019 - 00s


Thu 04 July 2019 - 00s
  take the day off - 00s


Fri 05 July 2019 - 00s


Sat 06 July 2019 - 00s


Sun 07 July 2019 - 00s


Mon 08 July 2019 - 00s

csv support

chimera  ~/  watson aggregate --csv       Mon 08 Jul 2019 04:24:40 PM CDT
project,to,tag,from,time
take the day off,2019-07-04 23:59:59,,2019-07-04 00:00:00,0.0

lunar support

chimera  ~/  watson log --luna -G
Thursday 04 July 2019 (00s)
  c9874b9  00:00 to 00:00          00s  take the day off

- reorder ungrouped completions
- add missing comment
- adds --luna to report and log
- adds --at to stop
k4nar
k4nar previously approved these changes Jul 9, 2019
Copy link
Collaborator

@k4nar k4nar left a comment

Choose a reason for hiding this comment

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

I approve the idea, but I didn't test it 😄 .

@andrewmeyer
Copy link
Contributor Author

@nesmyslny might be able to help test this

@ybc37
Copy link
Contributor

ybc37 commented Jul 11, 2019

Sorry for the late reply. I'm short of time, but hope to be able to test it in the next days.
Thanks so much for this :)

@ybc37
Copy link
Contributor

ybc37 commented Jul 12, 2019

I tested the changes and IMO it looks good! Thank you for fixing and improving the completions 💯

Not related to this PR: Personally I find the logic with required conditions for some options a bit confusing (e.g. __fish_watson_has_from). Example:

$ watson add -
# tab -> only completion result: `--from`

$ watson add --from "..." -
# tab -> completion results: every other option but `--from`

First I expected that if there's a --from the completion will only show --to and when those required options are set, completion gives all other options. That would be consistent IMHO.

But honestly, I don't expect such a logic (not sure how other completions do this; never thought about it). I'm happy with "dumb" completions 😄

I totally see this is a feature and don't want to push against it as this is just my opinion. Just wanted to give some feedback 😉

@andrewmeyer
Copy link
Contributor Author

andrewmeyer commented Jul 12, 2019

that is odd and somewhat unintended. The intended functionality is to only show --to if --from is provided. I'll play with that when I can and see if I can fix it in a future PR. good find!

-edit:
this was a bug: it was introduced by using __fish_watson_has_from instead of __fish_watson_using_command
fixed in 63d0199

Copy link
Contributor

@jmaupetit jmaupetit left a comment

Choose a reason for hiding this comment

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

Thanks @andrewmeyer 🙏

@jmaupetit jmaupetit merged commit 2e3928c into jazzband:master Jul 15, 2019
@andrewmeyer andrewmeyer deleted the update-fish-completions branch July 15, 2019 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fish Shell completions: aggregate is not included
4 participants