fix options parsing to handle spaces in the names

This commit is contained in:
Ben Fry
2013-08-21 12:28:02 -04:00
parent b0222c2d5e
commit 41d403889c
4 changed files with 21 additions and 5 deletions

View File

@@ -306,7 +306,7 @@ public class Table {
String[] opts = null;
if (options != null) {
opts = PApplet.splitTokens(options, " ,");
opts = PApplet.trim(PApplet.split(options, ','));
for (String opt : opts) {
if (opt.equals("tsv")) {
extension = "tsv";
@@ -915,7 +915,7 @@ public class Table {
throw new IllegalArgumentException("No extension specified for saving this Table");
}
String[] opts = PApplet.splitTokens(options, ", ");
String[] opts = PApplet.trim(PApplet.split(options, ','));
// Only option for save is the extension, so we can safely grab the last
extension = opts[opts.length - 1];
boolean found = false;