Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

completions: add new create options #857

Merged
merged 2 commits into from
Apr 30, 2024
Merged
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
8 changes: 1 addition & 7 deletions completions/configlet.bash
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,8 @@ _configlet_complete_create_() {
'-e' | '--exercise')
_configlet_complete_slugs_ "practice" "concept"
;;
'--concept-exercise')
_configlet_complete_slugs_ "concept"
;;
'--practice-exercise')
_configlet_complete_slugs_ "practice"
;;
*)
_configlet_complete_options_ "--approach --article -e --exercise $global_opts"
_configlet_complete_options_ "--approach --article --concept-exercise -e --exercise --practice-exercise -o --offline $global_opts"
;;
esac
}
Expand Down
3 changes: 3 additions & 0 deletions completions/configlet.fish
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ complete -c configlet -n "__fish_seen_subcommand_from completion" -s s -l shell
# create subcommand
complete -c configlet -n "__fish_seen_subcommand_from create" -s e -l exercise -d "exercise slug" \
-xa '(__fish_configlet_find_dirs ./exercises/{concept,practice})'
complete -c configlet -n "__fish_seen_subcommand_from create" -s o -l offline -d "Do not update prob-specs cache"
complete -c configlet -n "__fish_seen_subcommand_from create" -l approach -d "The slug of the approach"
complete -c configlet -n "__fish_seen_subcommand_from create" -l article -d "The slug of the article"
complete -c configlet -n "__fish_seen_subcommand_from create" -l practice-exercise -d "The slug of the practice exercise"
complete -c configlet -n "__fish_seen_subcommand_from create" -l concept-exercise -d "The slug of the concept exercise"

# fmt subcommand
complete -c configlet -n "__fish_seen_subcommand_from fmt" -s e -l exercise -d "exercise slug" \
Expand Down
3 changes: 3 additions & 0 deletions completions/configlet.zsh
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,11 @@ _configlet() {
_arguments "${_arguments_options[@]}" \
"$_configlet_global_opts[@]" \
'(-e --exercise)'{-e+,--exercise=}'[exercise slug]:slug:_configlet_complete_any_exercise_slug' \
{-o,--offline}'[Do not update prob-specs cache]' \
'--approach=[The slug of the approach]' \
'--article=[The slug of the article]' \
'--concept-exercise=[The slug of the concept exercise]' \
'--practice-exercise=[The slug of the practice exercise]' \
;;
(fmt)
_arguments "${_arguments_options[@]}" \
Expand Down