From: Jim Freeze Date: 2005-06-25T05:04:28+09:00 Subject: Re: [ANN] Application-0.6.0 * Eric Mahurin [2005-06-25 04:41:16 +0900]: > Great work, Jim! Looks like very quick way to get started on > an script - bypassing the tediousness of option/arg parsing and > a documentation framework. Thanks > I have a few more comments: > > * allow the definition of long_description to appear in > comments above the application class with all of the rdoc > formatting (you'll need to parse $0 with rdoc utilities). I > think this gives a more ruby-like way of documenting scripts. I take patches. ;) If this is supported, how do you suggest handling the existance of both long_description and rdoc. > * make a certain set of options enabled by default: man page, > version, usage, etc. That way all applications written in this > framework will immediately have this commonality. And then > have a way for the application class to delete this > functionality if it isn't wanted for some strange reason. Hmm, haven't thought about that, but sounds reasonable. If I follow the rails framework, then this would be a scaffold. However, I have not mentioned what is behind curtain #3, but I can tell you it is something that will generate a project directory structure and an application skeleton. This skeleton (scaffold in rails speak) could just include them as they are done now. Would this be ok or do you still think there should be implicit options that a user must delete? > * automatic usage generation (on your TODO already?). You > should also allow a short description for the options and > arguments so that each option/arg will come out in a single > line. This is already supported. Here are the rules: -x Single character options desc. goes on same line. --x Double dash and single character options desc. goes on the same line. ---x Triple dash and single character desc. goes on the next line. --y Double dash and single character options description that wraps to the next line. You usually only see this for POSIX options. > * in your examples, show how the options are accessed by main. > > This looks very similar to a package I wrote for perl years ago > (option/arg parsing, automatic usage, semi-automatic man page > handling). On man pages for that package, I decided to > automatically generate POD (like rdoc comments) from the > option/arg description and then have programmer paste it in the > script and maintain it. I believe the way you are doing it is > a more maintainable approach (i.e. when you add/change/delete > an option the man page is automatically updated), but the man > page formatting is not very flexible. Probably a good > tradeoff. What about adding a #to_rdoc so the app can document itself? -- Jim Freeze