Package arq.cmdline

Examples of arq.cmdline.CmdLineArgs.process()


{
    public void test_Simple1()
    {
        String args[] = new String[]{ ""} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        cl.process() ;
    }
   
    public void test_Flag1()
    {
        String args[] = new String[]{ ""} ;
View Full Code Here


    {
        String args[] = new String[]{ ""} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(false, "-a") ;
        cl.add(argA) ;
        cl.process() ;
        assertTrue("-a argument found" , ! cl.contains(argA) ) ;
    }
   
    public void test_Flag2()
    {
View Full Code Here

    {
        String args[] = new String[]{ "-a"} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(false, "-a") ;
        cl.add(argA) ;
        cl.process() ;
        assertTrue("No -a argument found" , cl.contains(argA) ) ;
    }

    public void test_Flag3()
    {
View Full Code Here

    {
        String args[] = new String[]{ "-a", "filename"} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(false, "-a") ;
        cl.add(argA) ;
        cl.process() ;
        assertTrue("No -a argument found" , cl.contains(argA) ) ;
    }
   
    public void test_Arg1()
    {
View Full Code Here

    {
        String args[] = new String[]{ ""} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(true, "-arg") ;
        cl.add(argA) ;
        cl.process() ;
        assertTrue("-arg argument found" , ! cl.contains(argA) ) ;
    }
   
    public void test_Arg2()
    {
View Full Code Here

    {
        String args[] = new String[]{ "-arg=ARG", "filename"} ;
        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(true, "-arg") ;
        cl.add(argA) ;
        cl.process() ;
        assertTrue("No -arg= argument found" , cl.contains(argA) ) ;
        assertEquals("", cl.getValue(argA) , "ARG") ;
        assertEquals("", cl.getArg("arg").getValue() , "ARG") ;
    }
   
View Full Code Here

        CmdLineArgs cl = new CmdLineArgs(args) ;
        ArgDecl argA = new ArgDecl(true, "-arg") ;
        cl.add(argA) ;
        ArgDecl argV = new ArgDecl(false, "-v") ;
        cl.add(argV) ;
        cl.process() ;
        assertTrue("No -arg= argument found" , cl.contains(argA) ) ;
       
        Iterator<String> iter = cl.getValues("arg").iterator() ;
        assertEquals("Argument 1", iter.next() , "V1") ;
        assertEquals("Argument 2", iter.next() , "V2") ;
View Full Code Here

       
        ArgDecl printDecl =  new ArgDecl(ArgDecl.HasValue, "print") ;
        cl.add(printDecl) ;

        try {
            cl.process() ;
        } catch (IllegalArgumentException ex)
        {
            System.err.println(ex.getMessage()) ;
            usage(System.err) ;
            throw new CmdException() ;
View Full Code Here

       
        ArgDecl printDecl =  new ArgDecl(ArgDecl.HasValue, "print") ;
        cl.add(printDecl) ;

        try {
            cl.process() ;
        } catch (IllegalArgumentException ex)
        {
            System.err.println(ex.getMessage()) ;
            usage(System.err) ;
            throw new CmdException() ;
View Full Code Here

       
        ArgDecl printDecl =  new ArgDecl(ArgDecl.HasValue, "print") ;
        cl.add(printDecl) ;

        try {
            cl.process() ;
        } catch (IllegalArgumentException ex)
        {
            System.err.println(ex.getMessage()) ;
            usage(System.err) ;
            throw new CmdException() ;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.