@@ -23,6 +23,10 @@ func NewMockCmd() *cobra.Command {
2323 cmd := & cobra.Command {
2424 Use : "mock" ,
2525 Short : "Run RPM mock tool" ,
26+ Long : `Run RPM mock tool commands directly.
27+
28+ Provides low-level access to mock for building RPMs from SRPMs and
29+ starting interactive shell sessions in mock chroot environments.` ,
2630 }
2731
2832 cmd .AddCommand (NewBuildRPMCmd ())
@@ -58,6 +62,16 @@ func NewBuildRPMCmd() *cobra.Command {
5862 cmd := & cobra.Command {
5963 Use : "build-rpms" ,
6064 Short : "Use mock to build an RPM" ,
65+ Long : `Build binary RPMs from a source RPM using mock.
66+
67+ This is a low-level command that invokes mock directly with the given
68+ SRPM and configuration. For most use cases, prefer 'azldev component build'
69+ which handles source preparation and overlay application automatically.` ,
70+ Example : ` # Build from an SRPM
71+ azldev advanced mock build-rpms --srpm ./my-package.src.rpm -o ./rpms/
72+
73+ # Build with a custom mock config
74+ azldev advanced mock build-rpms -c my-mock.cfg --srpm ./my-package.src.rpm -o ./rpms/` ,
6175 RunE : azldev .RunFuncWithoutRequiredConfig (func (env * azldev.Env ) (results interface {}, err error ) {
6276 return BuildRPMS (env , options )
6377 }),
@@ -94,6 +108,22 @@ func NewShellCmd() *cobra.Command {
94108 cmd := & cobra.Command {
95109 Use : "shell" ,
96110 Short : "Enter mock shell" ,
111+ Long : `Start an interactive shell inside a mock chroot environment.
112+
113+ This is useful for inspecting built RPMs, debugging package issues, or
114+ running smoke tests. Packages can be pre-installed into the chroot using
115+ --add-package. Extra arguments after -- are passed to the shell command.` ,
116+ Example : ` # Open a mock shell
117+ azldev advanced mock shell
118+
119+ # Open a shell with packages pre-installed
120+ azldev advanced mock shell --add-package /path/to/my-package.rpm
121+
122+ # Open a shell with network access
123+ azldev advanced mock shell --enable-network
124+
125+ # Run a command inside the mock shell
126+ azldev advanced mock shell -- rpm -qa` ,
97127 RunE : azldev .RunFuncWithoutRequiredConfigWithExtraArgs (
98128 func (env * azldev.Env , extraArgs []string ) (results interface {}, err error ) {
99129 return true , RunShell (env , options , extraArgs )
0 commit comments