What you want is to use shortcode attributes. I Googled “wordpress shortcode attributes” and found the sample code below in the WP Codex
// [bartag foo="foo-value"]
function bartag_func( $atts ) {
$a = shortcode_atts( array(
'foo' => 'something',
'bar' => 'something else',
), $atts );
return "foo = {$a['foo']}";
}
add_shortcode( 'bartag', 'bartag_func' );
You would want to pass an array for the example you show in your question
[short-code names="John", "Jack", "Mary"]
You can get the list of names by following the sample code and accessing the names array:
foreach($a['names'] as $name){
echo "<p>$name</p>";
}
Edit:
Just to be clear you would get the array from args as such:
$a = shortcode_atts( array(
'names' => 'names'
), $atts );