public static void main(String[] args) throws Exception {
        Options options=new Options();
        if(args.length==0) {
            System.out.println("rrpm [-r repofile ...] [-s] [-a] [-l username] [-y yaml_path ...] manifest ...\n"+
                               " where \n"+
                               "   -s : refresh SNAPSHOTs\n"+
                               "   -a : refresh everything\n"+
                               "   -n : No new installs, fail if any new RPM is to be installed\n"+
                               "   -d : No deletions, fail if any RPM is to be deleted\n"+
                               "   -u : No updates, fail if not all RPMs are all new or to be deleted\n"+
                               "   -l username : username\n"+
                               "   -p : Only print changes, don't update\n"+
                               "   -y yaml_path : yaml file to use to override versions\n"+
                               "Repo file format:\n"+
                               "   reponame=url [sequence]\n"+
                               "where optional sequence gives the sequence with which repository will be used to resolve RPMs.\n"+
                               "\n"+
                               "Manifest file format:\n"+
                               "host=url\n"+
                               "import=file,file,...\n"+
                               "package_name=arch:<arch> [epoch:<epoch>] [version:<version>] [release:<release>] [repo:<reponame>] [action:install|erase]\n"+
                               " where:\n"+
                               "  package_name: The RPM package name\n"+
                               "  arch: architecture. Required\n"+
                               "  epoch: Optional. If not given, LATEST assumed\n"+
                               "  version: Optional. If not given, LATEST assumed\n"+
                               "  release: Optional. If not given, LATEST assumed\n"+
                               "  repo: Optional. If given, only this repo is used to resolve the RPM\n"+
                               "  action: Optional. If not given, install is assumed.\n\n"+
                               "Any RPM imported will be overriden by the RPM definitions in the current file.");
        } else {
            List<YumRepo> repositories=new ArrayList<YumRepo>();
            
            ArrayList<String> newArgs=new ArrayList();
            for(String x:args)
                newArgs.add(x);

            String userName=null;
            boolean done=false;
            int index;
            do {
                index=newArgs.indexOf("-r");
                if(index!=-1) {
                    addRepoFile(repositories,newArgs.get(index+1));
                    newArgs.remove(index);
                    newArgs.remove(index);
                } else
                    done=true;
            } while(!done);

            index=newArgs.indexOf("-l");
            if(index!=-1) {
                userName=newArgs.get(index+1);
                newArgs.remove(index);
                newArgs.remove(index);
            }

            done = false;
            do {
                index = newArgs.indexOf("-y");
                if (index != -1) {
                    options.yamlOverrides.add(newArgs.get(index + 1));
                    newArgs.remove(index);
                    newArgs.remove(index);
                } else {
                    done = true;
                }
            } while (!done);

            options.printOnly=getFlag(newArgs,"-p");
            options.refreshSnapshots=getFlag(newArgs,"-s");
            options.refreshEverything=getFlag(newArgs,"-a");
            options.noNewInstalls=getFlag(newArgs,"-n");
            options.noDeletions=getFlag(newArgs,"-d");
            options.noUpdates=getFlag(newArgs,"-u");

            for(String host:newArgs) {
                processHost(host,userName,repositories,options);
            }
        }
    }