package net.sf.jabref;

import org.junit.Assert;
import org.junit.Test;

import java.util.Arrays;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;

public class JabRefCLITest {

    @Test
    public void testCLIParsingLongOptions() {
        JabRefCLI cli = new JabRefCLI(new String[] {"--nogui", "--import=some/file", "--output=some/export/file"});

        Assert.assertEquals("[]", Arrays.toString(cli.getLeftOver()));
        Assert.assertEquals("some/file", cli.getFileImport());
        Assert.assertTrue(cli.isDisableGui());
        Assert.assertEquals("some/export/file", cli.getFileExport());
    }

    @Test
    public void testCLIParsingShortOptions() {
        JabRefCLI cli = new JabRefCLI(new String[] {"-n", "-i=some/file", "-o=some/export/file"});

        Assert.assertEquals("[]", Arrays.toString(cli.getLeftOver()));
        Assert.assertEquals("some/file", cli.getFileImport());
        Assert.assertTrue(cli.isDisableGui());
        Assert.assertEquals("some/export/file", cli.getFileExport());
    }

}
@@ -1057,9 +1057,333 @@
 %0A    %7D%0A%0A
+    @Test%0A    public void testPreferencesExport() %7B%0A        JabRefCLI cli = new JabRefCLI(new String%5B%5D %7B%22-n%22, %22-x=some/file%22%7D);%0A%0A        Assert.assertEquals(%22%5B%5D%22, Arrays.toString(cli.getLeftOver()));%0A        Assert.assertEquals(%22some/file%22, cli.getPreferencesExport());%0A        Assert.assertTrue(cli.isDisableGui());%0A    %7D%0A%0A
 %7D

Add test for export command line option