public static void main( String[] args )
	{
		System.out.println( "NanoHTTPD 1.0 (c) 2001 Jarno Elonen\n" +
							"(Command line options: [port] [--licence])\n" );

		// Show licence if requested
		int lopt = -1;
		for ( int i=0; i<args.length; ++i )
		if ( args[i].toLowerCase().endsWith( "licence" ))
		{
			lopt = i;
			System.out.println( LICENCE + "\n" );
		}
		
		// Change port if requested
		int port = 80;
		if ( args.length > 0 && lopt != 0 )
			port = Integer.parseInt( args[0] );
		
		if ( args.length > 1 && 
			 args[1].toLowerCase().endsWith( "licence" ))
				System.out.println( LICENCE + "\n" );
		
		NanoHTTPD nh = null;
		try
		{
			nh = new NanoHTTPD( port );
		}
		catch( IOException ioe )
		{
			System.err.println( "Couldn't start server:\n" + ioe );
			System.exit( -1 );
		}
		nh.myFileDir = new File("");
		
		System.out.println( "Now serving files in port " + port + " from \"" +
							new File("").getAbsolutePath() + "\"" );
		System.out.println( "Hit Enter to stop.\n" );
				
		try { System.in.read(); } catch( Throwable t ) {};
	}