ct create: Listing available templates via `ct create -l`

master
Denis Knauf 2021-06-07 13:54:54 +02:00
parent f816ac3bc2
commit 1ff6ee163a
1 changed files with 4 additions and 0 deletions

View File

@ -57,7 +57,11 @@ def cli_ct
if %w[-h --help].include? template
STDERR.puts "Usage: ct create TEMPLATE -h # Shows template-related options"
STDERR.puts " ct create TEMPLATE [OPTIONS] # Creates a container"
STDERR.puts " ct create -l # Listing available templates"
exit 1
elsif %w[-l --list].include? template
STDERR.puts PVE::CTTemplate.constants.reject {|c|:Base==c}.map {|c|c.to_s.titlecase.dasherize.downcase}
exit 0
end
ctopts = {}
OptionParser.new do |opts|