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

Skip unoccupied tags #2

Merged
merged 1 commit into from
Dec 17, 2023
Merged

Skip unoccupied tags #2

merged 1 commit into from
Dec 17, 2023

Conversation

stefur
Copy link
Owner

@stefur stefur commented Dec 17, 2023

This adds the possbility to skip unoccupied tags when using cycle-tags as requested in #1. Append the flag -o or --occupied to the command in order move the tagmask over only the occupied tags.

Note to self: update readme and help.

@justinlovinger
Copy link

--occupied cycles to unoccupied tags when cycling previous on the first occupied tag or cycling next on the last occupied tag. For example, calling flow cycle-tags next 32 --occupied on tag 8 when 1 and 8 are occupied should cycle to 1. Instead, it cycles to 9, then 10, then 13, etc. Other than that minor issue, it works.

P.S. I suggest using Clap to parse arguments, as a separate pull-request of course, https://docs.rs/clap/latest/clap/. It also automatically generates help.

@stefur
Copy link
Owner Author

stefur commented Dec 17, 2023

--occupied cycles to unoccupied tags when cycling previous on the first occupied tag or cycling next on the last occupied tag. For example, calling flow cycle-tags next 32 --occupied on tag 8 when 1 and 8 are occupied should cycle to 1. Instead, it cycles to 9, then 10, then 13, etc. Other than that minor issue, it works.

You're right. Admittedly I only use 6 tags so I never caught that mistake. Hopefully got it working properly now.

P.S. I suggest using Clap to parse arguments, as a separate pull-request of course, https://docs.rs/clap/latest/clap/. It also automatically generates help.

Yeah, I opted for picoargs for the simplicity. Always trade-offs. :)

@justinlovinger
Copy link

You're right. Admittedly I only use 6 tags so I never caught that mistake. Hopefully got it working properly now.

It appears to work now from my end.

Yeah, I opted for picoargs for the simplicity. Always trade-offs. :)

The utility may be complex enough now to warrant something more complex, such as allowing flow cycle-tags -o ... in addition to flow cycle-tags ... -o, but you do you.

The user can now append the flag `-o`or `--occupied` to the `cycle-tags` command in order to cycle the tagmask over only occupied tags.
@stefur stefur merged commit 4c5c763 into main Dec 17, 2023
1 check passed
@stefur stefur deleted the skip-unoccupied branch December 17, 2023 18:35
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