Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
threadexio committed Jun 15, 2022
2 parents 2011cfb + eb9e697 commit b087596
Show file tree
Hide file tree
Showing 21 changed files with 1,046 additions and 757 deletions.
13 changes: 12 additions & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ name = "builder"
path = "src/builder.rs"

[dependencies]
termcolor = "^1.1"
clap = { version = "^3.1", features = ["cargo"] }
clap_complete = "^3.1"
tokio = { version = "^1.18", features = ["full"] }
Expand All @@ -31,3 +30,4 @@ ctrlc = { version = "^3.2", features = ["termination"] }
const_format = "^0.2"
default-env = "^0.1"
reqwest = { version = "^0.11", features = ["json"] }
colored = "^2.0"
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ clean: FORCE

.PHONY:
completions: FORCE
./target/$(BUILD_TYPE)/zeus misc --shell bash > completions/zeus.bash
./target/$(BUILD_TYPE)/zeus misc --shell zsh > completions/zeus.zsh
./target/$(BUILD_TYPE)/zeus misc --shell fish > completions/zeus.fish
./target/$(BUILD_TYPE)/zeus completions --shell bash > completions/zeus.bash
./target/$(BUILD_TYPE)/zeus completions --shell zsh > completions/zeus.zsh
./target/$(BUILD_TYPE)/zeus completions --shell fish > completions/zeus.fish

.PHONY:
package: build
Expand Down
24 changes: 12 additions & 12 deletions completions/zeus.bash
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ _zeus() {
build)
cmd+="__build"
;;
completions)
cmd+="__completions"
;;
help)
cmd+="__help"
;;
misc)
cmd+="__misc"
;;
query)
cmd+="__query"
;;
Expand All @@ -37,7 +37,7 @@ _zeus() {

case "${cmd}" in
zeus)
opts="-h -V -v --help --version --color --verbose --force --builddir --aur sync remove build query misc help"
opts="-h -V -d --help --version --color --debug --force --builddir --aur sync remove build query completions help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
Expand Down Expand Up @@ -92,31 +92,31 @@ _zeus() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
zeus__help)
opts="<SUBCOMMAND>..."
zeus__completions)
opts="-h --shell --help"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--shell)
COMPREPLY=($(compgen -W "" -- "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
esac
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
zeus__misc)
opts="-h --shell --help"
zeus__help)
opts="<SUBCOMMAND>..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
fi
case "${prev}" in
--shell)
COMPREPLY=($(compgen -W "" -- "${cur}"))
return 0
;;
*)
COMPREPLY=()
;;
Expand Down
8 changes: 4 additions & 4 deletions completions/zeus.fish
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ complete -c zeus -n "__fish_use_subcommand" -l builddir -d 'Package build direct
complete -c zeus -n "__fish_use_subcommand" -l aur -d 'AUR host' -r
complete -c zeus -n "__fish_use_subcommand" -s h -l help -d 'Print help information'
complete -c zeus -n "__fish_use_subcommand" -s V -l version -d 'Print version information'
complete -c zeus -n "__fish_use_subcommand" -s v -l verbose -d 'Be verbose'
complete -c zeus -n "__fish_use_subcommand" -s d -l debug -d 'Show debug logs'
complete -c zeus -n "__fish_use_subcommand" -l force -d 'Ignore all warnings'
complete -c zeus -n "__fish_use_subcommand" -f -a "sync" -d 'Sync packages'
complete -c zeus -n "__fish_use_subcommand" -f -a "remove" -d 'Remove packages'
complete -c zeus -n "__fish_use_subcommand" -f -a "build" -d 'Build/Update builder image'
complete -c zeus -n "__fish_use_subcommand" -f -a "query" -d 'Query the AUR'
complete -c zeus -n "__fish_use_subcommand" -f -a "misc" -d 'Generate shell completions & others'
complete -c zeus -n "__fish_use_subcommand" -f -a "completions" -d 'Generate shell completions & others'
complete -c zeus -n "__fish_use_subcommand" -f -a "help" -d 'Print this message or the help of the given subcommand(s)'
complete -c zeus -n "__fish_seen_subcommand_from sync" -l buildargs -d 'Extra arguments for makepkg' -r
complete -c zeus -n "__fish_seen_subcommand_from sync" -l image -d 'Builder image name' -r
Expand All @@ -26,5 +26,5 @@ complete -c zeus -n "__fish_seen_subcommand_from query" -l by -d 'Query AUR pack
complete -c zeus -n "__fish_seen_subcommand_from query" -l output -d 'Output format' -r -f -a "{pretty ,json }"
complete -c zeus -n "__fish_seen_subcommand_from query" -s i -l info -d 'Display additional information on results'
complete -c zeus -n "__fish_seen_subcommand_from query" -s h -l help -d 'Print help information'
complete -c zeus -n "__fish_seen_subcommand_from misc" -l shell -d 'Specify shell to generate completions for' -r -f -a "{bash ,elvish ,fish ,powershell ,zsh }"
complete -c zeus -n "__fish_seen_subcommand_from misc" -s h -l help -d 'Print help information'
complete -c zeus -n "__fish_seen_subcommand_from completions" -l shell -d 'Specify shell to generate completions for' -r -f -a "{bash ,elvish ,fish ,powershell ,zsh }"
complete -c zeus -n "__fish_seen_subcommand_from completions" -s h -l help -d 'Print help information'
18 changes: 9 additions & 9 deletions completions/zeus.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ _zeus() {
'--help[Print help information]' \
'-V[Print version information]' \
'--version[Print version information]' \
'-v[Be verbose]' \
'--verbose[Be verbose]' \
'-d[Show debug logs]' \
'--debug[Show debug logs]' \
'--force[Ignore all warnings]' \
":: :_zeus_commands" \
"*::: :->zeus" \
Expand Down Expand Up @@ -74,7 +74,7 @@ _arguments "${_arguments_options[@]}" \
'*::keywords -- Keywords to use:' \
&& ret=0
;;
(misc)
(completions)
_arguments "${_arguments_options[@]}" \
'--shell=[Specify shell to generate completions for]: :(bash elvish fish powershell zsh)' \
'-h[Print help information]' \
Expand All @@ -98,7 +98,7 @@ _zeus_commands() {
'remove:Remove packages' \
'build:Build/Update builder image' \
'query:Query the AUR' \
'misc:Generate shell completions & others' \
'completions:Generate shell completions & others' \
'help:Print this message or the help of the given subcommand(s)' \
)
_describe -t commands 'zeus commands' commands "$@"
Expand All @@ -108,16 +108,16 @@ _zeus__build_commands() {
local commands; commands=()
_describe -t commands 'zeus build commands' commands "$@"
}
(( $+functions[_zeus__completions_commands] )) ||
_zeus__completions_commands() {
local commands; commands=()
_describe -t commands 'zeus completions commands' commands "$@"
}
(( $+functions[_zeus__help_commands] )) ||
_zeus__help_commands() {
local commands; commands=()
_describe -t commands 'zeus help commands' commands "$@"
}
(( $+functions[_zeus__misc_commands] )) ||
_zeus__misc_commands() {
local commands; commands=()
_describe -t commands 'zeus misc commands' commands "$@"
}
(( $+functions[_zeus__query_commands] )) ||
_zeus__query_commands() {
local commands; commands=()
Expand Down
2 changes: 1 addition & 1 deletion src/aur.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct Aur {
}

#[allow(non_snake_case)]
#[derive(Debug, Serialize, Deserialize)]
#[derive(Debug, Default, Serialize, Deserialize)]
pub struct Package {
pub ID: Option<Id>,
pub Name: Option<String>,
Expand Down
Loading

0 comments on commit b087596

Please sign in to comment.