Using Configuration Files with Command Suites
Suppose we’ve enhanced our todo app to sync our tasks with an external task management service like JIRA.[39] We created todo as a lightweight replacement for such systems, but we still might want to send tasks to and from this system to facilitate collaboration with others on our team. We’d need at least three new global options: a URL where JIRA is running, a username, and a password to access it.
Suppose further that the new command will require the user to provide a group name to allow JIRA to properly file the ticket (a group might be something like “corporate web site” or “analytics database”). Let’s assume we’ve added these features, as shown in this sample help output:
| $ todo ... |
Get Build Awesome Command-Line Applications in Ruby 2 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.