Refactor and restructure CLI
commit7195c2f2dc727bf8e35832ecc8154361c9db05d9
authorDag Odenhall <dag.odenhall@gmail.com>
Sat, 26 Apr 2008 10:00:31 +0000 (26 12:00 +0200)
committerDag Odenhall <dag.odenhall@gmail.com>
Sat, 26 Apr 2008 10:00:59 +0000 (26 12:00 +0200)
tree3137a78d7ee8be5268d2d282997f91622bdb7e5b
parentc84158cb4c9b3f91cc35e54afb8c12c8d9fb577a
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.
lib/amazing/cli.rb
lib/amazing/cli/commands.rb [new file with mode: 0644]
lib/amazing/cli/helpers.rb [new file with mode: 0644]
lib/amazing/cli/initializers.rb [new file with mode: 0644]