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

Depreciate argument parsing code in favour of argbash #115

Open
gdevenyi opened this issue Aug 5, 2019 · 7 comments
Open

Depreciate argument parsing code in favour of argbash #115

gdevenyi opened this issue Aug 5, 2019 · 7 comments

Comments

@gdevenyi
Copy link
Contributor

gdevenyi commented Aug 5, 2019

I love and use the other features of bash3boilerplate. But I found https://argbash.io/ and it has completely replaced my usage for argument parsing, it is a vastly superior implementation.

@kvz
Copy link
Owner

kvz commented Aug 19, 2019

That's a lot of docs to read, do i understand that we'd need to ship dependencies with bash3boilerplate? while i think our implementation isn't the prettiest, i think not requiring dependencies is a nice thing of b3bp?
https://argbash.readthedocs.io/en/stable/install.html#install

@gdevenyi
Copy link
Contributor Author

Nope, there's no need to ship anything with the resulting script.

Fundamentally, its a m4 preprocessor that generates bash code upon being processed.

For example, I just wrote these lines:
https://github.com/CobraLab/iterativeN4_multispectral/blob/master/iterativeN4_multispectral.sh#L3-L29

And then I do:

argbash iterativeN4_multispectral.sh -o iterativeN4_multispectral.sh

And it generated all the code you see in these lines:
https://github.com/CobraLab/iterativeN4_multispectral/blob/master/iterativeN4_multispectral.sh#L30-L289

If I update my command-line specification, I just rerun the command, and it rewrites the parser.

@kvz
Copy link
Owner

kvz commented Nov 5, 2019

Okay so it's a bit like you would need a transpile step before you could run the bash script. We'd also need m4 to be installed everywhere. Is it ubiquitous?

I'm tempted to go along with this proposal so that we can remove the beast that our cli parsing has grown into, but at the same time, much of the appeal of b3bp was (and is to me still at least) that it can run on any thing that has bash3, no strings attached 🤔

@gdevenyi
Copy link
Contributor Author

gdevenyi commented Nov 5, 2019

Okay so it's a bit like you would need a transpile step before you could run the bash script. We'd also need m4 to be installed everywhere. Is it ubiquitous?

m4 is part of the "build-essential" of Ubuntu, it's a pretty classic piece of software that you should find on any machine with development happening. I love b3bp for the other features, but argbash's parser is just so vastly superior that I wonder why we should be duplicating the effort.

@kvz
Copy link
Owner

kvz commented Nov 6, 2019 via email

@gdevenyi
Copy link
Contributor Author

gdevenyi commented Nov 6, 2019

Well the transpiling is only needed once, for the person writing the script, after that argbash generates/embeds the parser in regular bash code. transpiling is only needed again if one modifies the definitions of the parser and needs to update the code.

@kvz
Copy link
Owner

kvz commented Nov 6, 2019 via email

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