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

Display/list all possible trigger names #9

Open
hstenn opened this issue Sep 22, 2024 · 2 comments
Open

Display/list all possible trigger names #9

hstenn opened this issue Sep 22, 2024 · 2 comments

Comments

@hstenn
Copy link

hstenn commented Sep 22, 2024

I understand I and the NTP Project may be the last users of BK. That's OK.

I'd like a way to get a list of all possible trigger names.

I've been using BK long enough that I have seen the list of trigger names change, and I have a trigger handling mechanism where it is Good if I can automatically check the list of trigger names in case a new release (I'm not holding my breath) happens to change the list of trigger names.

@wscott
Copy link
Member

wscott commented Sep 22, 2024

Typically the manpages are very good and list everything.

src/trigger.c has the trigger(cmd, when) function.

The big if block gives you all the possible values for cmd and if you grep for where trigger() is called you will set all the possible values you when.

But looking at the code I see what you probably want. Set BK_SHOW_TRIGGERS=/tmp/bk-triglist.txt in the environment and it will write a debug file with all the trigger for a given command.

@hstenn
Copy link
Author

hstenn commented Sep 25, 2024

Thanks, Wayne, and in this case I'm looking for something I can run as opposed to something a human has to look at. I know I can pipe the output of 'bk help trigger' and search for pre- and post-, but that finds extra keywords that are not correct, and it's also possible that the 'man' process will hyphenate things to make a line shorter. If I could, for example, just say 'bk trigger list' (or similar) and get the actual known list, that would be ideal. I note this here just to have it as an 'issue', as it's something we will likely choose to fix at some point.

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

No branches or pull requests

2 participants