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

Request: .cli file linter ... clint #426

Open
troglobit opened this issue Mar 14, 2023 · 3 comments
Open

Request: .cli file linter ... clint #426

troglobit opened this issue Mar 14, 2023 · 3 comments

Comments

@troglobit
Copy link
Contributor

Hi, we're cross-compiling Clixon and currently, when there's a syntax error in one of the .cli files, it's not until we start the CLI on target that you get a warning:

root@infix:~# cli
/usr/lib/clixon/clispec/core-cli.cli:36: Error: syntax error: at or before: ')'
Mar 13 14:19:33: cli_load_syntax_file: 303: Plugins: failed to parse cli file /usr/lib/clixon/clispec/core-cli.cli

Is there a way to run a host-built clixon_cli in a bare-bones way1 that it can act as a .cli file linter? Maybe I'm alone in this struggle, but if not, maybe a stripped down clixon_cli could be called clint 😃

Footnotes

  1. The obvious way is of course to develop the .cli file natively first, but maybe other ppl have had the same idea for a linter?

@olofhagsand
Copy link
Member

I think you could probably use the cligen_file -f <file> utility for this, see https://github.com/clicon/cligen/blob/master/cligen_file.c

@troglobit
Copy link
Contributor Author

I think you could probably use the cligen_file -f <file> utility for this

Nice, that'll do just fine, thanks!

@olofhagsand
Copy link
Member

Actually I think this could just be repackacked and installed properly as a feature to be avialable at build time.
Therefore reopen.

@olofhagsand olofhagsand reopened this Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants