diff --git a/checkpointctl.go b/checkpointctl.go index 1ddf69e7..b73cb197 100644 --- a/checkpointctl.go +++ b/checkpointctl.go @@ -16,6 +16,7 @@ var ( printStats bool showMounts bool fullPaths bool + showAll bool ) func main() { @@ -62,13 +63,23 @@ func setupShow() *cobra.Command { false, "Display mounts with full paths", ) + flags.BoolVar( + &showAll, + "all", + false, + "Display all additional information about the checkpoints", + ) return cmd } func show(cmd *cobra.Command, args []string) error { + if showAll { + printStats = true + showMounts = true + } if fullPaths && !showMounts { - return fmt.Errorf("Cannot use --full-paths without --mounts option") + return fmt.Errorf("Cannot use --full-paths without --mounts/-all option") } input := args[0] diff --git a/test/checkpointctl.bats b/test/checkpointctl.bats index f401ae92..718a1a70 100644 --- a/test/checkpointctl.bats +++ b/test/checkpointctl.bats @@ -168,7 +168,7 @@ function teardown() { ( cd "$TEST_TMP_DIR1" && tar cf "$TEST_TMP_DIR2"/test.tar . ) checkpointctl show "$TEST_TMP_DIR2"/test.tar --full-paths [ "$status" -eq 1 ] - [[ ${lines[0]} == *"Error: Cannot use --full-paths without --mounts option"* ]] + [[ ${lines[0]} == *"Error: Cannot use --full-paths without --mounts/-all option"* ]] } @test "Run checkpointctl show with tar file with valid config.dump and valid spec.dump (CRI-O) and no checkpoint directory" {