Changeset [7195c2f2dc727bf8e35832ecc8154361c9db05d9] by Dag Odenhall
Revision 7195c2f2dc727bf8e35832ecc8154361c9db05d9,
committed by Dag Odenhall
· April 26th, 2008 @ 12:00 PM
Refactor and restructure CLI
- lib/amazing/cli.rb: Require CLI initializers, helpers
and commands.
(Amazing) Fix bad documentation for CLI.
(CLI) Include initializers, helpers and commands.
(initialize) Move most aspects to Initializers
named with initialize_ prefix. Set at_exit here
rather than in #run.
(run) Move most stuff to Helpers and Commands
where helpers have arbitrary names and commands
are prefixed with cmd_. Move trap to before updates.
- lib/amazing/cli/initializers.rb: CLI initializers.
These mostly set up variables before run.
- lib/amazing/cli/helpers.rb: CLI helpers.
These do abit of anything but shouldn't exit.
- lib/amazing/cli/commands.rb: CLI commands.
Commands requested by the user via switches,
may exit the program.
4 changed files
-
A
lib/amazing/cli/commands.rb -
A
lib/amazing/cli/helpers.rb -
A
lib/amazing/cli/initializers.rb -
M
lib/amazing/cli.rb