Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

ml bash command line argument parsing (helpful for app_specific extensions) #695

Closed
bobstarbird opened this issue Nov 17, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@bobstarbird
Copy link

Please consider replacing $* with "$@" to preserve quoted command line arguments with spaces
ruby -I deploy -I deploy/lib deploy/lib/ml.rb $* || exit 1
with
ruby -I deploy -I deploy/lib deploy/lib/ml.rb "$@" || exit 1

@dmcassel
Copy link
Collaborator

@bobstarbird can you give us an example we could use to test this?

@bobstarbird
Copy link
Author

bobstarbird commented Nov 17, 2016

I wrote a app_specific.rb which would receive argument from the command
line with embedded space excerpt here:

def test_args()
arg1 = ARGV.shift
arg2 = ARGV.shift
cmd = %Q{echo "#{arg1}" "#{arg2}"}
print "#{cmd}\n"
end

ml local test_args "nospace" "has some spaces"
ml local test_args "has some spaces" "nospace"

expected output on LINUX would be
"nospace" "has some spaces"
"has some spaces" "nospace"

@dmcassel dmcassel changed the title ml bash command line argument parsing (helpfule for app_specific extensions) ml bash command line argument parsing (helpful for app_specific extensions) Nov 17, 2016
@dmcassel
Copy link
Collaborator

Thanks @bobstarbird, looks pretty straightforward.

@dmcassel dmcassel added this to the 1.7.5 milestone Nov 17, 2016
@RobertSzkutak RobertSzkutak modified the milestones: 1.7.6, 1.7.5 Jan 30, 2017
@dmcassel dmcassel modified the milestones: 1.7.6, April 2017 Jan 30, 2017
@RobertSzkutak RobertSzkutak removed this from the April 2017 milestone May 5, 2017
@grtjn grtjn added bug and removed enhancement labels Jun 8, 2017
@grtjn grtjn added this to the July 2017 milestone Jun 8, 2017
grtjn added a commit to grtjn/roxy that referenced this issue Jun 12, 2017
@grtjn grtjn removed the deployer label Jun 12, 2017
@grtjn grtjn self-assigned this Jun 12, 2017
RobertSzkutak added a commit that referenced this issue Jul 28, 2017
Fixed #695: applied quotes around bash args, consistently
@RobertSzkutak
Copy link
Contributor

Fixed in DEV

@grtjn grtjn self-assigned this Jul 28, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants