Sunday, 16 January 2011

Managing script options: Getopt-Long-Descriptive

I use GetOpt::Long for all my scripts, and as many other people I have my own methods to handle some logic for many of the standard options that my scripts have (-verbose -debug -test -run -in_file -out_file -bsub, etc...). Things get complicated when you check if your script has the right options, some times there are incompatible options, or alternative ones, or if you pass -test, many mandatory options are not mandatory anymore. And also you need to provide the right message for each scenario and write the usage message.

Today reading the code of the WWW::PivotalTracker::Command Perl module I have seen that it uses Getopt::Long::Descriptive. This is right away the module that I was looking for. It implements the 'one of these', 'required', etc.., and also writes the usage automatically for you. I have not tried it yet but I will give it a try this week. Any comments about other users experiences would be welcome.



PivotalTracker perl module

I like XP and Agile programming style. And I am very fond of day and week to-do lists to mark project goals achievements. I have recently started to use PivotalTraker for managing my projects tasks and recod completion velocity and I am very happy with it. I use it as a companion to the workplace Jira (old version with no extensions so a very handicaped Jira.). Therefore I am using PivotalTraker as a pseudo jira extension ( when I finish a week I export the stories to CSV and paste into Jira).

I love the approach of PivotalTraker and also is good that it is easy to import/export data. Also it has perl bindings to its API: WWW-PivotalTracker . I will try it soon.