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

ev-cli: Add argument to get template paths #156

Merged
merged 10 commits into from
Oct 15, 2024
Merged

Conversation

hikinggrass
Copy link
Contributor

No description provided.

ev-dev-tools/CMakeLists.txt Outdated Show resolved Hide resolved
ev-dev-tools/src/ev_cli/helpers.py Outdated Show resolved Hide resolved
@@ -740,6 +762,11 @@ def main():
'files (default: {everest-dir}/build/generated/generated/modules)')
mod_genld_parser.set_defaults(action_handler=module_genld)

mod_get_templates_parser = mod_actions.add_parser(
'get-templates', aliases=['gt'], parents=[common_parser], help='get paths to template files')
mod_get_templates_parser.add_argument('-s', '--seperator', type=str, default=';', help='Seperator between interface files (default: ;)')
Copy link
Contributor

Choose a reason for hiding this comment

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

it should be separator (not seperator :) ). This gives indeed some flexibility, but maybe it is a bit too much. I know the ; is convenient here, because of cmakes list parsing.
But most unix command line tools find, grep ... I know of return multiple values separated by linebreaks \n, and this would be what I would expect here. On the cmake side one could adapt with using

string(REPLACE "\n" ";" OUTPUT ${OUTPUT})

This might look a bit ugly on the cmake side, but still, this semicolon stuff is more of a cmake implementation detail which shouldn't leak into the implementation of other tools. My point of view might seem a bit finical, but it is important to avoid unnecessary coupling.

Side note: I tried to pass a newline \n as the argument to --seperator, it is possible by passing --seperator $'\n' :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I've switched the default to \n and use the --separator flag in everst-core to get it in a cmake compatible format.

@hikinggrass hikinggrass force-pushed the feature/get-templates branch from b9df3a3 to 62634bc Compare October 14, 2024 12:21
@hikinggrass hikinggrass requested a review from a-w50 October 15, 2024 14:44
Copy link
Contributor

@a-w50 a-w50 left a comment

Choose a reason for hiding this comment

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

👍

@hikinggrass hikinggrass merged commit efc5aec into main Oct 15, 2024
7 checks passed
@hikinggrass hikinggrass deleted the feature/get-templates branch October 15, 2024 15:04
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