bash3boilerplate icon indicating copy to clipboard operation
bash3boilerplate copied to clipboard

Depreciate argument parsing code in favour of argbash

Open gdevenyi opened this issue 6 years ago • 7 comments

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.

gdevenyi avatar Aug 05 '19 13:08 gdevenyi

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

kvz avatar Aug 19 '19 14:08 kvz

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.

gdevenyi avatar Aug 19 '19 14:08 gdevenyi

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 :thinking:

kvz avatar Nov 05 '19 08:11 kvz

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.

gdevenyi avatar Nov 05 '19 13:11 gdevenyi

Needing to do transpiling before you can run a script is a big step to introduce for the community at large tho would you agree?

Sent from mobile, pardon the brevity.

On 5 Nov 2019, at 15:28, Gabriel A. Devenyi [email protected] wrote:

 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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kvz avatar Nov 06 '19 07:11 kvz

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.

gdevenyi avatar Nov 06 '19 13:11 gdevenyi

I realize that but it’s already a big thing to introduce for a project that embraces the archaic nature of bash and “no compilers” etc

Sent from mobile, pardon the brevity.

On 6 Nov 2019, at 14:33, Gabriel A. Devenyi [email protected] wrote:

 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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kvz avatar Nov 06 '19 17:11 kvz