Skip to content

docopt_get_values: doesn't handle arguments with whitespaces properly #70

Open
@nazarewk

Description

@nazarewk

This is not what I was expecting:

source "$(command -v docopts).sh"
declare -A args
args['FILE,#']=2
args['FILE,0']=somefile1
args['FILE,1']='some file with space inside'

array=( $(docopt_get_values args FILE) )

if [[ "${array[1]}" != 'some file with space inside' ]] ; then
	echo "element #1 is not properly set"
fi

if [[ "${array[*]}" == 'somefile1 some file with space inside' ]] ; then
	echo "5 elements - 1 per word"
fi

There is no indication it should not work in docs or comments

Metadata

Metadata

Assignees

No one assigned

    Labels

    waiting for more exampleMore input is required to clarify the problem. Please add more example to reproduce the issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions