Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,13 @@ hcp 2

## License
See [LICENSE](LICENSE).

## Manual Page

After installing the package, you can view the manual page for usage and options:

```
man hcp
```

This provides detailed information about available commands and usage examples.
35 changes: 35 additions & 0 deletions build_deb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,41 @@ chmod 755 $PKGDIR/DEBIAN/postinst
make
cp hcp $PKGDIR/usr/bin/hcp

# Create the man page BEFORE building the .deb
mkdir -p $PKGDIR/usr/share/man/man1
cat > $PKGDIR/usr/share/man/man1/hcp.1 <<'EOF'
.TH hcp 1 "$(date +%Y-%m-%d)" "$VERSION" "hcp manual"
.SH NAME
Comment on lines +70 to +74
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Here-doc is single-quoted ⇒ $VERSION and $(date …) never expand

Because the delimiter is quoted (<<'EOF'), both $VERSION and $(date +%Y-%m-%d) are written literally into the man page.
Removing the quotes (or switching to envsubst) fixes this.

-# Create the man page BEFORE building the .deb
-mkdir -p $PKGDIR/usr/share/man/man1
-cat > $PKGDIR/usr/share/man/man1/hcp.1 <<'EOF'
+# Create the man page BEFORE building the .deb
+mkdir -p "$PKGDIR/usr/share/man/man1"
+cat > "$PKGDIR/usr/share/man/man1/hcp.1" <<EOF
 .TH hcp 1 "$(date +%Y-%m-%d)" "$VERSION" "hcp manual"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Create the man page BEFORE building the .deb
mkdir -p $PKGDIR/usr/share/man/man1
cat > $PKGDIR/usr/share/man/man1/hcp.1 <<'EOF'
.TH hcp 1 "$(date +%Y-%m-%d)" "$VERSION" "hcp manual"
.SH NAME
# Create the man page BEFORE building the .deb
mkdir -p "$PKGDIR/usr/share/man/man1"
cat > "$PKGDIR/usr/share/man/man1/hcp.1" <<EOF
.TH hcp 1 "$(date +%Y-%m-%d)" "$VERSION" "hcp manual"
.SH NAME
🤖 Prompt for AI Agents
In build_deb.sh around lines 70 to 74, the here-doc delimiter is single-quoted,
causing variables $VERSION and the date command substitution to be written
literally instead of expanded. To fix this, remove the single quotes from the
here-doc delimiter so that variable and command expansions occur as intended
when generating the man page.

hcp \- Historical Clipboard Manager for X11
.SH SYNOPSIS
.B hcp
[service start | list | <index> | pop | --help | -h]
.SH DESCRIPTION
.B hcp
is a lightweight clipboard manager for X11 systems. It captures clipboard entries, maintains a history, and allows you to list, print, or remove entries. Designed for reliability and minimalism, it works directly with the X11 clipboard and is suitable for use as a background service or on-demand.
.SH COMMANDS
.TP
.B service start
Start clipboard monitoring service in the background.
.TP
.B list
List clipboard history.
.TP
.B <index>
Print clipboard entry at <index>.
.TP
.B pop
Remove most recent clipboard entry.
.TP
.B --help, -h
Show this help message.
.SH AUTHOR
Written by the hcp project contributors.
.SH SEE ALSO
clipboard(1)
EOF
gzip -f $PKGDIR/usr/share/man/man1/hcp.1

# Build the .deb package
dpkg-deb --build $PKGDIR

Expand Down