Compare commits

...

8 Commits

Author SHA1 Message Date
bad4adacda Update PKGBUILD
Fixed maintainer's name

Signed-off-by: Zacharias <zacharias@noreply.localhost>
2025-05-18 12:28:01 +02:00
32484f98fb Added some meta data for acreat info 2025-05-12 00:28:32 +02:00
c4e275a209 Updated hash 2025-05-11 23:59:54 +02:00
d74a5f4eea remmoved ^B aka 0x02 aka STX 2025-05-11 23:55:25 +02:00
3c8ca3814f At this point i'm lost in the world of git 2025-05-11 23:50:11 +02:00
4ebec5f008 Resolved merge conflict 2025-05-11 23:44:29 +02:00
503e4de0cd Recoverd clean version without build artifacts 2025-05-11 23:38:33 +02:00
e6138ddc72 Version, and Release bump, fixed dependency issues 2025-05-11 23:25:48 +02:00
5 changed files with 88 additions and 6 deletions

5
.gitignore vendored Normal file
View File

@@ -0,0 +1,5 @@
pkg
old
src
*.pkg.tar.*

View File

@@ -1,14 +1,27 @@
# PKGBUILD
pkgname=comp
pkgver=1.0
pkgrel=1
pkgver=1.2
pkgrel=6
pkgdesc="Simple folder compression with pv and pigz"
arch=('any')
license=('MIT')
depends=('tar' 'pv' 'pigz')
source=('comp.sh')
md5sums=('SKIP')
deps=('tar>0.0.0' 'pv>0.0.0' 'pigz>0.0.0')
source=('comp.sh' 'comp.bash' '_comp')
maintainer="Zacharias Zellén <zacharias@4zellen.se>"
url="https://server.4zellen.se:3000/Zacharias/comp"
prepare() {
sed -i "s/__VERSION__/$pkgver/" "$srcdir/comp.sh"
}
package() {
install -Dm755 "$srcdir/comp.sh" "$pkgdir/usr/bin/comp"
install -Dm644 "$srcdir/comp.bash" "$pkgdir/usr/share/bash-completion/completions/comp"
install -Dm644 "$srcdir/_comp" "$pkgdir/usr/share/zsh/site-functions/_comp"
}
sha256sums=('27ad990dc4eded0204660e9da704a92ca33b52e63014e9c731f771bf942be7f3'
'e90c5e24ad932296b932a8dd0cfcc42051209a755828408229d73c2dc6321e83'
'8ed621a9435b3f6d066abde2fb7eae964dda82ab90824b7fc07d167834863633')

19
_comp Normal file
View File

@@ -0,0 +1,19 @@
#compdef comp
_comp() {
_arguments \
'-h[Prints help message]' \
'--help[Prints help message]' \
'-v[Print version]' \
'--version[Print version]' \
'1:file or folder to compress:_files_or_dirs' \
'2:output file:_files'
# Custom function to complete both files and directories
_files_or_dirs() {
_alternative \
'directories:: _directories' \
'files:: _files'
}
}

23
comp.bash Normal file
View File

@@ -0,0 +1,23 @@
# completions/comp.bash
_comp_completions()
{
local cur prev opts
COMPREPLY=()
cur = "${COMP_WORDS[COMP_CWORD]}"
prev = "${COMP_WORDS[COMP_CWORD-1]}"
opts = "-h --help -v --version"
if [[ "$cur" == -* ]]; then
COMPREPLY = ( $(compgen -W "${opts}" -- "$cur"))
return 0
fi
if [[ $COMP_CWORD -eq 1 ]]; then
COMPREPLY=( $(compgen -d -- "$cur") $(compgen -f -- "$cur"))
return 0
fi
return 0
}
complete -F _comp_completions comp

24
comp.sh Normal file → Executable file
View File

@@ -3,8 +3,30 @@
# Usage: comp <folder_to_compress> [output_fildename]
# Check if input folder is provided
VERSION="__VERSION__"
if [[ -z "$1" ]]; then
echo "Usage: comp <folder_to_compress> [output_filename]"
echo "Usage: comp <folder_or_file_to_compress> [output_file]"
echo "comp <options>"
exit 1
elif [[ "$1" == "-h" || "$1" == "--help" ]]; then
echo "Usage:"
echo " comp <folder_or_file_to_compress> [output_file]"
echo " comp <option>"
echo ""
echo "Options:"
echo " -h --help: Print's this message"
echo " -v --version: Ptints the current version"
exit 0
elif [[ "$1" == "-v" || "$1" == "--version" ]]; then
echo "comp version: $VERSION"
exit 0
elif [[ ! -d "$1" || ! -f "$1" ]]; then
echo "Invalid argument '$1'"
echo "Usage:"
echo " comp <folder_to_compress> [output_file]"
echo " comp <option>"
exit 1
fi