| 1 | package App::SD::CLI::Command::Help::History; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'App::SD::CLI::Command::Help'; | ||
| 4 | |||
| 5 | sub run { | ||
| 6 | my $self = shift; | ||
| 7 | $self->print_header('Viewing Database History'); | ||
| 8 | my ${cmd}= $self->cli->get_script_name; | ||
| 9 | |||
| 10 | print <<EOF | ||
| 11 | You can view a history of all changes to the database using the 'log' | ||
| 12 | command. It can be run in the following ways: | ||
| 13 | |||
| 14 | ${cmd}log | ||
| 15 | Shows the last 20 changes. | ||
| 16 | |||
| 17 | ${cmd}log --all | ||
| 18 | ${cmd}log -a | ||
| 19 | Shows the entire history from start to end. | ||
| 20 | |||
| 21 | ${cmd}log <since>..<until> | ||
| 22 | Shows the range of history starting at <since> and ending at | ||
| 23 | <until>. Ranges can be specified using either sequence numbers | ||
| 24 | or an offset from the most recent change, designated by | ||
| 25 | LATEST~offset. | ||
| 26 | |||
| 27 | Examples: | ||
| 28 | |||
| 29 | ${cmd}log 0..5 | ||
| 30 | Shows changes 0 through 5. | ||
| 31 | |||
| 32 | ${cmd}log LATEST | ||
| 33 | Shows the most recent change. | ||
| 34 | |||
| 35 | ${cmd}log LATEST~4 | ||
| 36 | Shows changes from 4 before the most recent change up to the most | ||
| 37 | recent change. | ||
| 38 | |||
| 39 | ${cmd}log 2..LATEST~5 | ||
| 40 | Shows the second change up through 5 before the latest. | ||
| 41 | |||
| 42 | ${cmd}log LATEST~10..LATEST~5 | ||
| 43 | Shows changes from 10 before the latest to 5 before the latest. | ||
| 44 | EOF | ||
| 45 | |||
| 46 | } | ||
| 47 | |||
| 48 | __PACKAGE__->meta->make_immutable; | ||
| 49 | no Any::Moose; | ||
| 50 | |||
| 51 | 1; | ||
| 52 |