Skip to content

Commit

Permalink
optimized
Browse files Browse the repository at this point in the history
Signed-off-by: leleliu008 <[email protected]>
  • Loading branch information
leleliu008 committed Aug 27, 2023
1 parent 566f44b commit 490bcf1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 23 deletions.
30 changes: 15 additions & 15 deletions ppkg
Original file line number Diff line number Diff line change
Expand Up @@ -7370,7 +7370,7 @@ main() {

PPKG="$CURRENT_SCRIPT_FILEPATH"

PPKG_VERSION=0.1.5
PPKG_VERSION=0.1.6

PPKG_OFFICAL_FORMULA_REPO_URL="https://github.com/leleliu008/ppkg-formula-repository-offical-core.git"
PPKG_UPGRAGE_URL='https://raw.githubusercontent.com/leleliu008/ppkg/master/ppkg'
Expand Down Expand Up @@ -7413,6 +7413,20 @@ main() {
gen-url-transform-sample)
shift
__gen_url_transform_sample "$@"
return 0
;;
env)
cat <<EOF
ppkg.version : $PPKG_VERSION
ppkg.homedir : $PPKG_HOME
ppkg.exepath : $PPKG
ppkg.website : https://github.com/leleliu008/ppkg

EOF
if [ -f "$PPKG_CORE_DIR/env" ] && [ -f "$UPPM" ] ; then
"$UPPM" env
fi

return 0
;;
esac
Expand Down Expand Up @@ -7486,20 +7500,6 @@ main() {
case $1 in
sysinfo)
sysinfo
return 0
;;
env)
cat <<EOF
ppkg.version : $PPKG_VERSION
ppkg.homedir : $PPKG_HOME
ppkg.exepath : $PPKG
ppkg.website : https://github.com/leleliu008/ppkg

EOF
if [ -f "$PPKG_CORE_DIR/env" ] && [ -f "$UPPM" ] ; then
"$UPPM" env
fi

return 0
;;
ls-available) shift; __list_available_packages ;;
Expand Down
12 changes: 4 additions & 8 deletions ppkg-zsh-completion
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#compdef ppkg

_commands=(
_ppkg_actions=(
'-h:show help of this command.'
'--help:show help of this command.'
'-V:show version of this command.'
Expand Down Expand Up @@ -42,10 +42,6 @@ _commands=(
'gen-url-transform-sample:generate url-transform sample.'
)

function _ppkg_commands() {
_describe 'command' _commands
}

function _ppkg_available_packages() {
local -a _available_packages
_available_packages=($(ppkg ls-available 2>/dev/null))
Expand All @@ -69,7 +65,7 @@ function _ppkg() {
typeset -A opt_args

_arguments \
'1: :_ppkg_commands' \
'1: :{_describe ppkg_actions _ppkg_actions}' \
'*:: :->option'

case $state in
Expand Down Expand Up @@ -160,13 +156,13 @@ function _ppkg() {
_arguments \
'1:package-name:_ppkg_available_packages' \
'-t[set output format]:output-type:(dot box svg png)' \
'-o[set output filepath or directory]:output-path:{_files}'
'-o[set output filepath or directory]:output-path:_files'
;;
pack)
_arguments \
'1:package-name:_ppkg_installed_packages' \
'-t[set output type]:output-type:(zip tar.gz tar.xz tar.lz tar.bz2)' \
'-o[set output filepath or directory]:output-path:{_files}' \
'-o[set output filepath or directory]:output-path:_files' \
'--keep-packing-dir[do not delete packing dir even if packed success]'
;;
tree)
Expand Down

0 comments on commit 490bcf1

Please sign in to comment.