Split code in functions:
Using functions is an easy way to reduce the levels of indentation.
The higher the number, the easier to make mistakes.
Also, it helps to differentiate groups of functionalities.
Remove code that is not needed:
There is no need to check for Singularity, as the previous logic
always evaluated to True.
There is no need to keep track of argument number.
Use a different function for each docker command.
Even though right now all code is in a single one, args_create,
now we have all the logic in case we need to do something special
with a given docker command in the future.
Some minor aesthetic changes to make code more readable.
Split code in functions: Using functions is an easy way to reduce the levels of indentation. The higher the number, the easier to make mistakes. Also, it helps to differentiate groups of functionalities.
Remove code that is not needed: There is no need to check for Singularity, as the previous logic always evaluated to True. There is no need to keep track of argument number.
Use a different function for each docker command. Even though right now all code is in a single one, args_create, now we have all the logic in case we need to do something special with a given docker command in the future.
Some minor aesthetic changes to make code more readable.