More complete help message.
parent
cc3620b4ad
commit
9d4b2adf7b
14
src/main.cr
14
src/main.cr
|
@ -50,6 +50,14 @@ class RootFS::Context
|
|||
@configuration = Baguette::Configuration.new "rootfs"
|
||||
end
|
||||
|
||||
def print_commands_help
|
||||
STDOUT << "commands:" << "\n"
|
||||
STDOUT << " new <template> <rootfs-directory>\n"
|
||||
STDOUT << " save <rootfs-directory> <snapshot-directory>\n"
|
||||
STDOUT << " restore <rootfs-directory> <snapshot-directory>\n"
|
||||
# Other commands are not implemented at the moment.
|
||||
end
|
||||
|
||||
def run
|
||||
options_parser = uninitialized OptionParser
|
||||
|
||||
|
@ -71,7 +79,8 @@ class RootFS::Context
|
|||
},
|
||||
# FIXME: This needs access to the list of commands.
|
||||
"help" => ->(args : Array(String)){
|
||||
STDOUT << options_parser << "\n"
|
||||
STDOUT << options_parser << "\n\n"
|
||||
print_commands_help
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +95,8 @@ class RootFS::Context
|
|||
end
|
||||
|
||||
parser.on "-h", "--help", "Displays this help message." do
|
||||
STDOUT << parser << "\n"
|
||||
STDOUT << parser << "\n\n"
|
||||
print_commands_help
|
||||
exit 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue