You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Consider passing raw command line args to initialize.sh for early processing/parsing. #685
Some scripts or CLIs may need to parse command-line arguments/options during early initialization (in initialize.sh). Currently, since the initialize function is called with no arguments, things like $# is 0 and $@ is empty at that point. Additionally, $args hasn't been parsed yet during early initialization, making the raw arguments inaccessible.
Could we pass the arguments to initialize to enable early parsing? For example:
command_line_args=("$@")
initialize "${command_line_args[@]}"# pass args for early access if needed
run "${command_line_args[@]}"
changed the title [-]Consider passing command line args to initialize.sh[/-][+]Consider passing raw command line args to initialize.sh for early processing/parsing. [/+]on Nov 19, 2025
This feature is already available. If we were passing it to initialize, then you would have a copy of that array, and would not have been able to modify it.
It is done like this on purpose, so you can both read and modify it, by simply changing the command_line_args as you see fit.
Activity
[-]Consider passing command line args to initialize.sh[/-][+]Consider passing raw command line args to initialize.sh for early processing/parsing. [/+]DannyBen commentedon Nov 19, 2025
This feature is already available. If we were passing it to
initialize, then you would have a copy of that array, and would not have been able to modify it.It is done like this on purpose, so you can both read and modify it, by simply changing the
command_line_argsas you see fit.More info:
bashly add hooksyou will get this initialize file with some instructions comment that explains it.Does this cover your use case?
surgiie commentedon Nov 19, 2025
@DannyBen Yes sorry i guess i failed to find these docs. 😓
DannyBen commentedon Nov 19, 2025
No worries - if you failed to find the docs, it is also a bug :)
If you think this should be mentioned somewhere else as well, let me know.