1
# Copyright 2008 Amazon.com, Inc. or its affiliates. All Rights
2
# Reserved. Licensed under the Amazon Software License (the
3
# "License"). You may not use this file except in compliance with the
4
# License. A copy of the License is located at
5
# http://aws.amazon.com/asl or in the "license" file accompanying this
6
# file. This file is distributed on an "AS IS" BASIS, WITHOUT
7
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See
8
# the License for the specific language governing permissions and
9
# limitations under the License.
11
require 'ec2/amitools/bundlemachineparameters'
13
# The Bundle Image command line parameters.
14
class BundleImageParameters < BundleMachineParameters
16
IMAGE_PATH_DESCRIPTION = "The path to the file system image to bundle."
17
PREFIX_DESCRIPTION = "The filename prefix for bundled AMI files. Defaults to image name."
19
attr_reader :image_path
22
def initialize( argv, name )
23
add_mandatory_parameters_proc = lambda do
24
on( '-i', '--image PATH', String, IMAGE_PATH_DESCRIPTION ) do |p|
25
unless p and File::exist?( p )
26
raise "the specified image file #{p} does not exist"
32
add_optional_parameters_proc = lambda do
33
on( '-p', '--prefix PREFIX', String, PREFIX_DESCRIPTION ) do |p|
38
super(argv, name, add_mandatory_parameters_proc, add_optional_parameters_proc)