@@ -28,7 +28,7 @@ pub struct BuildArguments {
2828 /// The image version being built.
2929 #[ arg(
3030 short, long,
31- value_parser = parse_image_version,
31+ value_parser = BuildArguments :: parse_image_version,
3232 default_value_t = Self :: default_image_version( ) ,
3333 help_heading = "Image Options"
3434 ) ]
@@ -112,15 +112,33 @@ pub struct BuildArguments {
112112 pub strip_architecture : bool ,
113113
114114 /// Loads the image into the local image store.
115+ ///
116+ /// DEPRECATED: Use -- --load instead.
115117 #[ arg( long, help_heading = "Build Options" ) ]
118+ #[ deprecated( since = "0.1.7" , note = "Use -- --load instead" ) ]
116119 pub load : bool ,
117120
118121 /// Dry run. This does not build the image(s) but instead prints out the bakefile.
119122 #[ arg( short, long, alias = "dry" ) ]
120123 pub dry_run : bool ,
124+
125+ /// Arguments passed after '--' which are directly passed to the Docker command.
126+ ///
127+ /// Care needs to be taken, because these arguments can override/modify the behaviour defined
128+ /// via the generated Bakefile. A few save arguments include but are not limited to: --load,
129+ /// --no-cache, --progress.
130+ #[ arg( raw = true ) ]
131+ pub rest : Vec < String > ,
121132}
122133
123134impl BuildArguments {
135+ fn parse_image_version ( input : & str ) -> Result < Version , ParseImageVersionError > {
136+ let version = Version :: from_str ( input) . context ( ParseVersionSnafu ) ?;
137+ ensure ! ( version. build. is_empty( ) , ContainsBuildMetadataSnafu ) ;
138+
139+ Ok ( version)
140+ }
141+
124142 fn default_image_version ( ) -> Version {
125143 "0.0.0-dev" . parse ( ) . expect ( "must be a valid SemVer" )
126144 }
@@ -151,13 +169,6 @@ pub enum ParseImageVersionError {
151169 ContainsBuildMetadata ,
152170}
153171
154- pub fn parse_image_version ( input : & str ) -> Result < Version , ParseImageVersionError > {
155- let version = Version :: from_str ( input) . context ( ParseVersionSnafu ) ?;
156- ensure ! ( version. build. is_empty( ) , ContainsBuildMetadataSnafu ) ;
157-
158- Ok ( version)
159- }
160-
161172#[ derive( Debug , PartialEq , Snafu , EnumDiscriminants ) ]
162173pub enum ParseHostPortError {
163174 #[ snafu( display( "unexpected empty input" ) ) ]
0 commit comments