LDMX-Software / pflib

Library and tool for interacting with polarfires.
https://ldmx-software.github.io/pflib/
4 stars 0 forks source link

Autocompletion in poke_param #44

Closed Skelpdar closed 2 years ago

Skelpdar commented 2 years ago

It would be convenient to have autocompletion of page names and parameters in ROC -> POKE_PARAM

tomeichlersmith commented 2 years ago

The code implementing tab completion for the menu commands is

https://github.com/LDMX-Software/pflib/blob/19fae31ed51812ea2780c16ea20082cab4e166ce/tool/Menu.cc#L132-L156

and the static vector cmd_options_ is modified in Menu::steer

https://github.com/LDMX-Software/pflib/blob/19fae31ed51812ea2780c16ea20082cab4e166ce/tool/Menu.h#L339

I'm thinking it would be pretty simple to modify this code to allow the user to provide a vector of their own input options to a readline method that can then be used by the command_matcher. I think I could implement this; however, it is not very high priority (for me) so if you get something working feel free to push it and open a PR.