From 959cb5fd4f9586ec3bd265b452fe25fe1db82e3f Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 13 Jan 2015 23:25:04 -0500 Subject: source format change don't hate me too much if you were planning a big merge. =P --- src/cuchaz/enigma/Main.java | 41 ++++++++++++++++------------------------- 1 file changed, 16 insertions(+), 25 deletions(-) (limited to 'src/cuchaz/enigma/Main.java') diff --git a/src/cuchaz/enigma/Main.java b/src/cuchaz/enigma/Main.java index 73a12db..f8d3afe 100644 --- a/src/cuchaz/enigma/Main.java +++ b/src/cuchaz/enigma/Main.java @@ -14,46 +14,37 @@ import java.io.File; import cuchaz.enigma.gui.Gui; -public class Main -{ - public static void main( String[] args ) - throws Exception - { +public class Main { + + public static void main(String[] args) throws Exception { Gui gui = new Gui(); // parse command-line args - if( args.length >= 1 ) - { - gui.getController().openJar( getFile( args[0] ) ); + if (args.length >= 1) { + gui.getController().openJar(getFile(args[0])); } - if( args.length >= 2 ) - { - gui.getController().openMappings( getFile( args[1] ) ); + if (args.length >= 2) { + gui.getController().openMappings(getFile(args[1])); } // DEBUG - //gui.getController().openDeclaration( new ClassEntry( "none/ces" ) ); + // gui.getController().openDeclaration( new ClassEntry( "none/ces" ) ); } - private static File getFile( String path ) - { + private static File getFile(String path) { // expand ~ to the home dir - if( path.startsWith( "~" ) ) - { + if (path.startsWith("~")) { // get the home dir - File dirHome = new File( System.getProperty( "user.home" ) ); + File dirHome = new File(System.getProperty("user.home")); // is the path just ~/ or is it ~user/ ? - if( path.startsWith( "~/" ) ) - { - return new File( dirHome, path.substring( 2 ) ); - } - else - { - return new File( dirHome.getParentFile(), path.substring( 1 ) ); + if (path.startsWith("~/")) { + return new File(dirHome, path.substring(2)); + } else { + return new File(dirHome.getParentFile(), path.substring(1)); } } - return new File( path ); + return new File(path); } } -- cgit v1.2.3