Changeset 13098 for trunk/abcl/src/org


Ignore:
Timestamp:
12/17/10 22:18:33 (11 years ago)
Author:
vvoutilainen
Message:

Add a --help parameter that prints out command line arg help.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/src/org/armedbear/lisp/Interpreter.java

    r13092 r13098  
    5555    private static boolean nosystem = false;
    5656    private static boolean noinform = false;
     57    private static boolean help = false;
    5758
    5859    public static synchronized Interpreter getInstance()
     
    8485            out._writeString(banner());
    8586            out._finishOutput();
     87        }
     88        if (help) {
     89            Stream out = getStandardOutput();
     90            out._writeString(help());
     91            out._finishOutput();
     92            exit(0);
    8693        }
    8794        if (noinform)
     
    238245                } else if (arg.equals("--noinform")) {
    239246                    noinform = true;
     247                } else if (arg.equals("--help")) {
     248                    help = true;
    240249                } else if (arg.equals("--batch")) {
    241250                    _BATCH_MODE_.setSymbolValue(T);
     
    608617        return sb.toString();
    609618    }
     619    private static String help()
     620    {
     621        final String sep = System.getProperty("line.separator");
     622        StringBuilder sb = new StringBuilder("Parameters:");
     623        sb.append(sep);
     624        sb.append("--help displays this help");
     625        sb.append(sep);
     626        sb.append("--noinform suppresses the printing of version info");
     627        sb.append(sep);
     628        sb.append("--eval <form> evaluates the <form> before initializing REPL");
     629        sb.append(sep);
     630        sb.append("--load <file> loads the file <file> before initializing REPL");
     631        sb.append(sep);
     632        sb.append("--load-system-file <file> loads the system file <file> before initializing REPL");
     633        sb.append(sep);
     634        sb.append("--batch enables batch mode. The --load, --load-system-file and --eval parameters are handled, and abcl exits without entering REPL");
     635        sb.append(sep);
     636        sb.append("--noinit suppresses loading a .abclrc startup file");
     637        sb.append(sep);
     638        sb.append("--nosystem suppresses loading the system startup file");
     639        sb.append(sep);
     640       
     641        return sb.toString();
     642    }
    610643}
Note: See TracChangeset for help on using the changeset viewer.