Skip to content

Commit

Permalink
dorothy-new: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Nov 11, 2023
1 parent b8f25c3 commit 7af60f7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
28 changes: 14 additions & 14 deletions commands.beta/dorothy-new
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ function dorothy_new() (
local item type='' cmd='' where='' path='' tmp=''
local cli='' app='' name='' setup_util_args=()
local args='' stdin='' distinct='' finish=''
local vargs='' sargs=() bflags=() sflags=() # @todo add parsing
local vargs='' sargs=() bflags=() sflags=() # @todo add parsing
local invocation='' about='' input='' output='' # @todo add parsing
while test "$#" -ne 0; do
item="$1"
Expand Down Expand Up @@ -115,11 +115,11 @@ function dorothy_new() (
else
type="$(
choose-option --no-title --required \
--question="What type of command is this?" \
--label -- \
command "$(echo-style --bold="command")"$'\nprocess arguments, execute something' \
transform "$(echo-style --bold="echo-*")"$'\ntransform input (args/stdin) into modified output' \
install "$(echo-style --bold="setup-util-*")"$'\ncross-platform installer for a package or application' \
--question="What type of command is this?" \
--label -- \
command "$(echo-style --bold="command")"$'\nprocess arguments, execute something' \
transform "$(echo-style --bold="echo-*")"$'\ntransform input (args/stdin) into modified output' \
install "$(echo-style --bold="setup-util-*")"$'\ncross-platform installer for a package or application'
)"
fi
done
Expand All @@ -136,12 +136,12 @@ function dorothy_new() (
function ask_where {
where="$(
choose-option --no-title --required \
--question="Where should the $1 go?" \
--label --default="$where" -- \
user "$(echo-style --bold="user/commands")"$'\nyour public configuration' \
local "$(echo-style --bold="user/commands.local")"$'\nyour private configuration' \
core "$(echo-style --bold="dorothy/commands")"$'\nthe dorothy core' \
beta "$(echo-style --bold="dorothy/commands.beta")"$'\nthe dorothy beta core'
--question="Where should the $1 go?" \
--label --default="$where" -- \
user "$(echo-style --bold="user/commands")"$'\nyour public configuration' \
local "$(echo-style --bold="user/commands.local")"$'\nyour private configuration' \
core "$(echo-style --bold="dorothy/commands")"$'\nthe dorothy core' \
beta "$(echo-style --bold="dorothy/commands.beta")"$'\nthe dorothy beta core'
)"
case "$where" in
user) path="$DOROTHY/user/commands/$cmd" ;;
Expand Down Expand Up @@ -177,7 +177,7 @@ function dorothy_new() (
ask_where 'command'
;;
transform)
ask_cmd --question="What to name the transformer? It should start with $(echo-style --code='echo-')" # once ai generations done, this should be last
ask_cmd --question="What to name the transformer? It should start with $(echo-style --code='echo-')" # once ai generations done, this should be last
ask_where 'transformer'
if test -z "$args"; then
if confirm --positive --ppid=$$ -- 'Should it transform arguments?'; then
Expand Down Expand Up @@ -249,7 +249,7 @@ function dorothy_new() (
--question="Which ecosystems does $name have a package on" \
--label -- "${eco_options[@]}"
)
for eco in "${ecosystems[@]}"; do
for eco in "${ecos_selection[@]}"; do
ecos["$eco"]="$(ask --question="What is the $eco package name?")"
done
;;
Expand Down
2 changes: 1 addition & 1 deletion docs/scripting/generator.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

The following is a proposal for a new command generator:

```
```plain
What type of command is this?
normal: process arguments, execute something
echo-*: transform input (args/stdin) into modified output
Expand Down

0 comments on commit 7af60f7

Please sign in to comment.