package fr.mantal.wcdl;

import java.nio.file.Files;
import java.nio.file.Paths;

public class Main
{
	public static void main(String[] args)
	{
		Downloader.fromConfig(getPath(args)).download();
	}

	private static String getPath(String[] args)
	{
		String arg0 = args.length > 1 ? args[0] : System.getProperty("user.dir");

		if (Files.isDirectory(Paths.get(arg0)))
			return Paths.get(arg0, ".config.wcdl").toString();
		return arg0;
	}
}

package fr.mantal.wcdl;

import java.nio.file.Files;
import java.nio.file.Paths;

public class Main
{
	public static void main(String[] args)
	{
		Downloader.fromConfig(getPath(args[0])).download();
	}

	private static String getPath(String arg0)
	{
		if (arg0.isEmpty())
			arg0 = System.getProperty("user.dir");

		if (Files.isDirectory(Paths.get(arg0)))
			return Paths.get(arg0, ".config.wcdl").toString();
		return arg0;
	}
}

--- 
+++ 
@@ -7,13 +7,12 @@
 {
 	public static void main(String[] args)
 	{
-		Downloader.fromConfig(getPath(args[0])).download();
+		Downloader.fromConfig(getPath(args)).download();
 	}
 
-	private static String getPath(String arg0)
+	private static String getPath(String[] args)
 	{
-		if (arg0.isEmpty())
-			arg0 = System.getProperty("user.dir");
+		String arg0 = args.length > 1 ? args[0] : System.getProperty("user.dir");
 
 		if (Files.isDirectory(Paths.get(arg0)))
 			return Paths.get(arg0, ".config.wcdl").toString();
Fix crash when launched without arguments

