More complete help message.

master
Luka Vandervelden 2020-12-12 17:49:45 +01:00
parent cc3620b4ad
commit 9d4b2adf7b
1 changed files with 12 additions and 2 deletions

View File

@ -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