defargparser 0.2 Copyright (c) 1999 David Lichteblau (david.lichteblau@snafu.de) Introduction ------------ defargparser is a set of macros designed to work on top of Eric Kidd's getopt library. The idea is to provide a more readable interface for parser definition and option access. Originally named `defparser', the library's new name is `defargparser'. (defargparser 0.1 == defparser 0.1) Changes from 0.1 to 0.2 - unique unique-id-base - makefile Installation ------------ First you have to patch the getopt library. defargparser wants to subclass , which is sealed by default. Edit common/getopt/getopt.dylan, add an open to the class and recompile getopt. If necessary, add an -L option to the D2CFLAGS in the makefile to make d2c aware of the patched getopt. Then try: $ make # calls d2c defargparser.lid $ make install # gd 2.3.1 needed Testing: $ cd examples examples$ d2c -L.. simple.lid # no synopsis xor examples$ d2c -L.. complex.lid # with synopsis examples$ ./test examples$ ./test -v foo bar examples$ ./test --logfile test.log a b examples$ ./test --help ... Documentation ------------- Have a look at the examples and at OVERVIEW. Emacs ----- You will want to edit your .emacs to recognize defargparser macros and keywords: (add-hook 'dylan-mode-hook (lambda () (add-dylan-keyword 'dyl-parameterized-definition-words "argument-parser") (add-dylan-keyword 'dyl-other-keywords "option") (add-dylan-keyword 'dyl-other-keywords "regular-arguments") (add-dylan-keyword 'dyl-other-keywords "synopsis")))