From d94c811e7ff4fc6ed8482951dfcd9f3d538c6d50 Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Fri, 4 Sep 2020 13:32:19 -0400 Subject: [PATCH] Use full kiss subcommands for readability and safety --- contrib/kiss-depends | 2 +- contrib/kiss-export | 2 +- contrib/kiss-fork | 4 ++-- contrib/kiss-link | 4 ++-- contrib/kiss-maintainer | 2 +- contrib/kiss-manifest | 5 ++--- contrib/kiss-outdated | 2 +- contrib/kiss-reset | 2 +- contrib/kiss-size | 2 +- 9 files changed, 12 insertions(+), 13 deletions(-) diff --git a/contrib/kiss-depends b/contrib/kiss-depends index 179fc42..95fff16 100755 --- a/contrib/kiss-depends +++ b/contrib/kiss-depends @@ -8,7 +8,7 @@ # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -kiss l "${1:-null}" >/dev/null || { +kiss list "${1:-null}" >/dev/null || { printf 'usage: kiss-depends [pkg]\n' exit 1 } diff --git a/contrib/kiss-export b/contrib/kiss-export index 2e8f24b..7541a1c 100755 --- a/contrib/kiss-export +++ b/contrib/kiss-export @@ -8,7 +8,7 @@ # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -kiss l "${1:-null}" >/dev/null || { +kiss list "${1:-null}" >/dev/null || { printf 'usage: kiss-export [pkg]\n' exit 1 } diff --git a/contrib/kiss-fork b/contrib/kiss-fork index db988bf..62b9f10 100755 --- a/contrib/kiss-fork +++ b/contrib/kiss-fork @@ -3,7 +3,7 @@ # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -[ "$1" ] && kiss s "${1:-null}" >/dev/null || { +[ "$1" ] && kiss search "${1:-null}" >/dev/null || { printf 'usage: [kiss-fork [pkg]] [index]\n' exit 1 } @@ -14,7 +14,7 @@ num=$2 # is intentional. This grabs the location of the package's files. # shellcheck disable=2046 ( - set -- $(kiss s "$1") + set -- $(kiss search "$1") shift "${num:-0}" diff --git a/contrib/kiss-link b/contrib/kiss-link index efb5c30..38e9bf4 100755 --- a/contrib/kiss-link +++ b/contrib/kiss-link @@ -16,7 +16,7 @@ oPWD=$PWD # Check if the package exists in a repository and error out here # if it does not. The error message from the package manager will # be displayed. -kiss s "${PWD##*/}" >/dev/null +kiss search "${PWD##*/}" >/dev/null # Disable this warning as globbing is disabled and word splitting # is intentional. This grabs the location of the package's files. @@ -25,7 +25,7 @@ kiss s "${PWD##*/}" >/dev/null # Generate a list of repositories in which the package # exists. Then 'cd' to the first found directory to do a # comparison. - set -- $(kiss s "${PWD##*/}"); cd "$1" + set -- $(kiss search "${PWD##*/}"); cd "$1" # Error if the package exists nowhere but the current # directory and this script would create a broken symlink. diff --git a/contrib/kiss-maintainer b/contrib/kiss-maintainer index 9b0080a..6dd7fc3 100755 --- a/contrib/kiss-maintainer +++ b/contrib/kiss-maintainer @@ -7,7 +7,7 @@ set -- "${PWD##*/}" } -kiss s "$@" | sort -u | while read -r repo; do cd "$repo" +kiss search "$@" | uniq -u | while read -r repo; do cd "$repo" m=$(git log -1 version 2>/dev/null) ||: m=${m##*Author: } m=${m%%>*} diff --git a/contrib/kiss-manifest b/contrib/kiss-manifest index 0652ade..298cdc7 100755 --- a/contrib/kiss-manifest +++ b/contrib/kiss-manifest @@ -1,15 +1,14 @@ #!/bin/sh -ef # Display all files owned by a package -# CRUX style usage using the current directory as the name of the package to be -# operated on. +# Use the current directory as the package name if no package is given. [ "$1" ] || { set -- "${PWD##*/}" } # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -kiss l "${1:-null}" >/dev/null || { +kiss list "${1:-null}" >/dev/null || { printf 'usage: kiss-manifest [pkg]\n' exit 1 } diff --git a/contrib/kiss-outdated b/contrib/kiss-outdated index 6fd110a..2092799 100755 --- a/contrib/kiss-outdated +++ b/contrib/kiss-outdated @@ -4,7 +4,7 @@ # Intended behavior. # shellcheck disable=2106 -kiss s "${@:-*}" | (while read -r pkg_loc _; do { +kiss search "${@:-*}" | (while read -r pkg_loc _; do { read -r ver _ 2>/dev/null < "$pkg_loc/version" || continue pkg=${pkg_loc##*/} diff --git a/contrib/kiss-reset b/contrib/kiss-reset index 730a8ed..ee80996 100755 --- a/contrib/kiss-reset +++ b/contrib/kiss-reset @@ -17,5 +17,5 @@ done [ "$1" ] && { printf 'WARNING: This will remove \033[1m%s\033[m package(s).\n' "$#" printf 'Continue? [Enter/Ctrl+C]\n' - read -r _ && KISS_FORCE=1 kiss r "$@" + read -r _ && KISS_FORCE=1 kiss remove "$@" } diff --git a/contrib/kiss-size b/contrib/kiss-size index 50949c1..b1e97a4 100755 --- a/contrib/kiss-size +++ b/contrib/kiss-size @@ -22,7 +22,7 @@ get_size() { # Ignore shellcheck as we want the warning's behavior. # shellcheck disable=2015 -kiss l "${1:-null}" >/dev/null || { +kiss list "${1:-null}" >/dev/null || { printf 'usage: kiss-size [pkg]\n' exit 1 }