Skip to content

Commit

Permalink
completions: add new create options (#857)
Browse files Browse the repository at this point in the history
* Update configlet completions for new `create` options

* add --offline too
  • Loading branch information
glennj authored Apr 30, 2024
1 parent 42e5b0a commit 0e3196a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
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

0 comments on commit 0e3196a

Please sign in to comment.