Skip to content

Commit 61291e8

Browse files
committed
quadlet: add cat alias for print
Add new alias `podman quadlet cat` to `podman quadlet print` to align Podman's quadlet CLI with systemd conventions. Fixes: #27296 Signed-off-by: Artem Sierikov <[email protected]>
1 parent 08c670b commit 61291e8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

cmd/podman/quadlet/print.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ var (
1717
Long: quadletPrintDescription,
1818
RunE: print,
1919
ValidArgsFunction: common.AutocompleteQuadlets,
20+
Aliases: []string{"cat"},
2021
Args: cobra.ExactArgs(1),
2122
Example: `podman quadlet print myquadlet.container
2223
podman quadlet print mypod.pod

docs/source/markdown/podman-quadlet-print.1.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,15 @@ podman\-quadlet\-print - Display the contents of a quadlet
66
## SYNOPSIS
77
**podman quadlet print** *quadlet*
88

9+
**podman quadlet cat** *quadlet*
10+
911
## DESCRIPTION
1012

1113
Print the contents of a Quadlet, displaying the file including all comments.
1214

1315
## EXAMPLES
1416

17+
Using `podman quadlet print` to display the contents of a quadlet named `myquadlet.container`:
1518
```
1619
$ podman quadlet print myquadlet.container
1720
[Container]

test/system/253-podman-quadlet.bats

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,10 @@ EOF
7575
run_podman quadlet print alpine-quadlet.container
7676
assert "$output" == "$(<$quadlet_file)" "print output matches quadlet file"
7777

78+
# Test quadlet cat
79+
run_podman quadlet cat alpine-quadlet.container
80+
assert "$output" == "$(<$quadlet_file)" "cat output matches quadlet file"
81+
7882
# Test quadlet rm
7983
run_podman quadlet rm alpine-quadlet.container
8084
# Verify remove output contains the quadlet name on a single line

0 commit comments

Comments
 (0)