(self, cmdp)
return self.STATUS_OK
save: save an image to file
        save [options] IMAGE
        --output=<image-file>       :save image to file
        -o <image-file>             :save image to file
save: save an image to file
        save [options] IMAGE
        --output=<image-file>       :save image to file
        -o <image-file>             :save image to file
save : save an image to file save [ options ] IMAGE -- output = <image - file > : save image to file - o <image - file > : save image to file
def do_save(self, cmdp):
        """
        save: save an image to file
        save [options] IMAGE
        --output=<image-file>       :save image to file
        -o <image-file>             :save image to file
        """
        imagefile = cmdp.get("--output=")
        if not imagefile:
            imagefile = cmdp.get("-o=")
            if not imagefile:
                imagefile = '-'
        from_stdin = cmdp.get('-')
        imagespec_list = cmdp.get("P*")
        if from_stdin:
            del imagespec_list[0]
            imagefile = '-'
            cmdp.get("-o")
        if cmdp.missing_options():  # syntax error
            return self.STATUS_ERROR
        if imagefile != '-':
            if os.path.exists(imagefile):
                Msg().err("Error: output file already exists:", imagefile)
                return self.STATUS_ERROR
        imagetag_list = []
        for imagespec in imagespec_list:
            (imagerepo, tag) = self._check_imagespec(imagespec)
            if not imagerepo:
                return self.STATUS_ERROR
            imagetag_list.append((imagerepo, tag))
        if not imagefile:
            Msg().err("Error: must specify filename of image file for output")
            return self.STATUS_ERROR
        if not self.localfileapi.save(imagetag_list, imagefile):
            return self.STATUS_ERROR
        return self.STATUS_OK
def do_save ( self , cmdp ) : imagefile = cmdp . get ( "--output=" ) if not imagefile : imagefile = cmdp . get ( "-o=" ) if not imagefile : imagefile = '-' from_stdin = cmdp . get ( '-' ) imagespec_list = cmdp . get ( "P*" ) if from_stdin : del imagespec_list [ 0 ] imagefile = '-' cmdp . get ( "-o" ) if cmdp . missing_options ( ) : # syntax error return self . STATUS_ERROR if imagefile != '-' : if os . path . exists ( imagefile ) : Msg ( ) . err ( "Error: output file already exists:" , imagefile ) return self . STATUS_ERROR imagetag_list = [ ] for imagespec in imagespec_list : ( imagerepo , tag ) = self . _check_imagespec ( imagespec ) if not imagerepo : return self . STATUS_ERROR imagetag_list . append ( ( imagerepo , tag ) ) if not imagefile : Msg ( ) . err ( "Error: must specify filename of image file for output" ) return self . STATUS_ERROR if not self . localfileapi . save ( imagetag_list , imagefile ) : return self . STATUS_ERROR return self . STATUS_OK