summaryrefslogtreecommitdiff
path: root/java/demo/Freeze/phonebook/RunParser.java
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
committerBernard Normier <bernard@zeroc.com>2007-02-01 17:09:49 +0000
commitabada90e3f84dc703b8ddc9efcbed8a946fadead (patch)
tree2c6f9dccd510ea97cb927a7bd635422efaae547a /java/demo/Freeze/phonebook/RunParser.java
parentremoving trace message (diff)
downloadice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.bz2
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.tar.xz
ice-abada90e3f84dc703b8ddc9efcbed8a946fadead.zip
Expanded tabs into spaces
Diffstat (limited to 'java/demo/Freeze/phonebook/RunParser.java')
-rw-r--r--java/demo/Freeze/phonebook/RunParser.java122
1 files changed, 61 insertions, 61 deletions
diff --git a/java/demo/Freeze/phonebook/RunParser.java b/java/demo/Freeze/phonebook/RunParser.java
index 3c3bdd20ada..d26371a80c7 100644
--- a/java/demo/Freeze/phonebook/RunParser.java
+++ b/java/demo/Freeze/phonebook/RunParser.java
@@ -14,26 +14,26 @@ class RunParser
static void
usage(String appName)
{
- System.err.println("Usage: " + appName + " [options] [file...]\n");
- System.err.print(
- "Options:\n" +
- "-h, --help Show this message.\n");
- //"-v, --version Display the Ice version.\n"
+ System.err.println("Usage: " + appName + " [options] [file...]\n");
+ System.err.print(
+ "Options:\n" +
+ "-h, --help Show this message.\n");
+ //"-v, --version Display the Ice version.\n"
}
static int
runParser(String appName, String[] args, Ice.Communicator communicator)
{
- String file = null;
- int idx = 0;
+ String file = null;
+ int idx = 0;
- while(idx < args.length)
- {
- if(args[idx].equals("-h") | args[idx].equals("--help"))
- {
- usage(appName);
- return 0;
- }
+ while(idx < args.length)
+ {
+ if(args[idx].equals("-h") | args[idx].equals("--help"))
+ {
+ usage(appName);
+ return 0;
+ }
/*
else if(args[idx].equals("-v") || args[idx].equals("--version"))
{
@@ -41,56 +41,56 @@ class RunParser
return 0;
}
*/
- else if(args[idx].charAt(0) == '-')
- {
- System.err.println(appName + ": unknown option `" + args[idx] + "'");
- usage(appName);
- return 1;
- }
- else
- {
- if(file == null)
- {
- file = args[idx];
- }
- else
- {
- System.err.println(appName + ": only one file is supported.");
- usage(appName);
- return 1;
- }
- ++idx;
- }
- }
+ else if(args[idx].charAt(0) == '-')
+ {
+ System.err.println(appName + ": unknown option `" + args[idx] + "'");
+ usage(appName);
+ return 1;
+ }
+ else
+ {
+ if(file == null)
+ {
+ file = args[idx];
+ }
+ else
+ {
+ System.err.println(appName + ": only one file is supported.");
+ usage(appName);
+ return 1;
+ }
+ ++idx;
+ }
+ }
- Ice.ObjectPrx base = communicator.propertyToProxy("PhoneBook.Proxy");
- PhoneBookPrx phoneBook = PhoneBookPrxHelper.checkedCast(base);
- if(phoneBook == null)
- {
- System.err.println(appName + ": invalid object reference");
- return 1;
- }
+ Ice.ObjectPrx base = communicator.propertyToProxy("PhoneBook.Proxy");
+ PhoneBookPrx phoneBook = PhoneBookPrxHelper.checkedCast(base);
+ if(phoneBook == null)
+ {
+ System.err.println(appName + ": invalid object reference");
+ return 1;
+ }
- Parser parser = new Parser(communicator, phoneBook);
- int status;
+ Parser parser = new Parser(communicator, phoneBook);
+ int status;
- if(file == null)
- {
- status = parser.parse();
- }
- else
- {
- try
- {
- status = parser.parse(new java.io.BufferedReader(new java.io.FileReader(file)));
- }
- catch(java.io.IOException ex)
- {
- status = 1;
- ex.printStackTrace();
- }
- }
+ if(file == null)
+ {
+ status = parser.parse();
+ }
+ else
+ {
+ try
+ {
+ status = parser.parse(new java.io.BufferedReader(new java.io.FileReader(file)));
+ }
+ catch(java.io.IOException ex)
+ {
+ status = 1;
+ ex.printStackTrace();
+ }
+ }
- return status;
+ return status;
}
}