Add CLI option parsing and implement layer unmounting

Replace the implicit single-argument invocation with getopt_long-based
flags: -m/--mount (existing mount flow, now explicit), -u/--umount
(unmounts a layer via containers-storage), -t/--test (stub),
-l/--log-level (runtime spdlog level), -h/--help, -V/--version.
--mount now also prints the top layer's ID so it can be passed to
--umount.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-10 09:03:58 +00:00
parent a301dfb44f
commit 7e1ee150f6
5 changed files with 143 additions and 6 deletions
+3 -1
View File
@@ -36,7 +36,9 @@ Build directory is `buildDir/` (already configured).
- Configure (only needed if `buildDir/` is missing or deleted): `meson setup buildDir`
- Build: `meson compile -C buildDir` (or `ninja -C buildDir`)
- Run the executable: `./buildDir/slocker_lite <image.tar>`
- Run the executable: `./buildDir/slocker_lite -m <image.tar>` (see `--help` for the
full flag list: `-m/--mount`, `-u/--umount`, `-t/--test`, `-l/--log-level`,
`-h/--help`, `-V/--version`)
- Run tests: `meson test -C buildDir`
## Code style