Package org.clapper.util.cmdline

Examples of org.clapper.util.cmdline.CommandLineUsageException


                                      String           longOption,
                                      Iterator<String> it)
        throws CommandLineUsageException,
               NoSuchElementException
    {
        throw new CommandLineUsageException ("Unrecognized option");
    }
View Full Code Here


                        break;

                    case 't':
                        if (textFile != null)
                        {
                            throw new CommandLineUsageException
                                ("Can't specify both -t and -T");
                        }

                        text = (String) it.next();
                        break;

                    case 'T':
                        if (text != null)
                        {
                            throw new CommandLineUsageException
                                ("Can't specify both -t and -T");
                        }

                        textFile = new File ((String) it.next());
                        break;

                    case 'm':
                        textMimeType = (String) it.next();
                        break;

                    case 'd':
                        debug = true;
                        break;

                    default:
                        // Should not happen.
                        throw new IllegalStateException ("(BUG) Bad option. " +
                                                           "Why am I here?");
                }
            }
        }

        catch (EmailException ex)
        {
            throw new CommandLineUsageException (ex);
        }
    }
View Full Code Here

                msg.addTo (it.next());
        }

        catch (EmailException ex)
        {
            throw new CommandLineUsageException (ex);
        }
    }
View Full Code Here

            case 'r':
                this.rollOverMsg = it.next();
                break;

            default:
                throw new CommandLineUsageException
                    ("Unknown option: " +
                     UsageInfo.LONG_OPTION_PREFIX +
                     longOption +
                     " (" +
                     UsageInfo.SHORT_OPTION_PREFIX +
View Full Code Here

            this.maxSize = Long.parseLong (s);
        }

        catch (NumberFormatException ex)
        {
            throw new CommandLineUsageException ("Bad value (\"" +
                                                 s +
                                                 "\" for maximum file size.");
        }

        s = it.next();
        try
        {
            maxFiles = Integer.parseInt (s);
        }

        catch (NumberFormatException ex)
        {
            throw new CommandLineUsageException ("Bad value of \"" + s +
                                                 "\" for maximum number " +
                                                 "of files.");
        }

        if (it.hasNext())
View Full Code Here

                    type = Type.BUFFER;
                else if (sType.equals ("XStringBuilder"))
                    type = Type.BUILDER;
                else
                {
                    throw new CommandLineUsageException ("Bad value of \"" +
                                                         type +
                                                         "\" for -t");
                }
                break;

            default:
                throw new CommandLineUsageException ("Unrecognized option");
        }
    }
View Full Code Here

            case 'p':
                preserveEmpty = true;
                break;

            default:
                throw new CommandLineUsageException ("Unrecognized option");
        }
    }
View Full Code Here

                                                       0.1f,
                                                       1.0f);
                break;

            default:
                throw new CommandLineUsageException ("Unrecognized option");
        }
    }
View Full Code Here

        {
            String s = it.next();
            String[] fields = TextUtil.split (s, "=");
            if (fields.length != 2)
            {
                throw new CommandLineUsageException ("Bad key=value pair: " +
                                                     "\"" +
                                                     s +
                                                     "\"");
            }
View Full Code Here

            case 'v':
                verbose = true;
                break;

            default:
                throw new CommandLineUsageException ("Unrecognized option");
        }
    }
View Full Code Here

TOP

Related Classes of org.clapper.util.cmdline.CommandLineUsageException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.