karnel-termux 4.7.7 → 4.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (215) hide show
  1. package/README.md +46 -5
  2. package/install.sh +2 -2
  3. package/karnel/cli/commands/backup.sh +13 -2
  4. package/karnel/cli/commands/doctor/fixes.sh +111 -13
  5. package/karnel/cli/commands/doctor.sh +112 -10
  6. package/karnel/cli/commands/init.sh +2 -2
  7. package/karnel/cli/commands/install.sh +155 -118
  8. package/karnel/cli/commands/list.sh +106 -13
  9. package/karnel/cli/commands/open.sh +28 -8
  10. package/karnel/cli/commands/reinstall.sh +79 -46
  11. package/karnel/cli/commands/restore.sh +16 -0
  12. package/karnel/cli/commands/robin.sh +656 -0
  13. package/karnel/cli/commands/search.sh +1 -0
  14. package/karnel/cli/commands/show.sh +1 -0
  15. package/karnel/cli/commands/start.sh +12 -2
  16. package/karnel/cli/commands/status.sh +11 -0
  17. package/karnel/cli/commands/uninstall.sh +47 -0
  18. package/karnel/cli/commands/update.sh +43 -0
  19. package/karnel/cli/commands/version.sh +2 -0
  20. package/karnel/cli/commands/voice.sh +11 -6
  21. package/karnel/cli/karnel.sh +115 -69
  22. package/karnel/modules/ai.sh +21 -6
  23. package/karnel/modules/deploy.sh +4 -0
  24. package/karnel/modules/dev.sh +19 -46
  25. package/karnel/modules/games.sh +81 -4
  26. package/karnel/modules/network.sh +88 -0
  27. package/karnel/modules/osint.sh +123 -0
  28. package/karnel/modules/shell.sh +1 -1
  29. package/karnel/modules/ui.sh +4 -0
  30. package/karnel/modules/utils.sh +88 -0
  31. package/karnel/modules/voice.sh +8 -2
  32. package/karnel/tools/ai/all.sh +1 -0
  33. package/karnel/tools/ai/antigravity-cli/install.sh +0 -0
  34. package/karnel/tools/ai/claude-code/install.sh +0 -0
  35. package/karnel/tools/ai/cline/install.sh +8 -8
  36. package/karnel/tools/ai/codegraph/install.sh +8 -5
  37. package/karnel/tools/ai/codex/install.sh +0 -0
  38. package/karnel/tools/ai/command-code/install.sh +0 -0
  39. package/karnel/tools/ai/copilot-termux/install.sh +0 -0
  40. package/karnel/tools/ai/crush/install.sh +1 -1
  41. package/karnel/tools/ai/ctx7/install.sh +0 -0
  42. package/karnel/tools/ai/engram/install.sh +5 -2
  43. package/karnel/tools/ai/freebuff/install.sh +0 -0
  44. package/karnel/tools/ai/gemini-cli/install.sh +0 -0
  45. package/karnel/tools/ai/gentle-ai/install.sh +1 -1
  46. package/karnel/tools/ai/hermes-agent/install.sh +0 -0
  47. package/karnel/tools/ai/kilocode-cli/install.sh +0 -0
  48. package/karnel/tools/ai/kimchi-code/install.sh +3 -1
  49. package/karnel/tools/ai/kimi-code/install.sh +0 -0
  50. package/karnel/tools/ai/kiro/install.sh +0 -0
  51. package/karnel/tools/ai/mimocode/install.sh +0 -0
  52. package/karnel/tools/ai/minimax-cli/install.sh +0 -0
  53. package/karnel/tools/ai/mistral-vibe/install.sh +0 -0
  54. package/karnel/tools/ai/odysseus/install.sh +0 -0
  55. package/karnel/tools/ai/ollama/install.sh +0 -0
  56. package/karnel/tools/ai/omni-route/install.sh +1 -1
  57. package/karnel/tools/ai/openclaude/install.sh +0 -0
  58. package/karnel/tools/ai/openclaw/install.sh +0 -0
  59. package/karnel/tools/ai/opencode/install.sh +0 -0
  60. package/karnel/tools/ai/openspec/install.sh +0 -0
  61. package/karnel/tools/ai/pi/install.sh +0 -0
  62. package/karnel/tools/ai/qoder/README.md +50 -0
  63. package/karnel/tools/ai/qoder/bin/qodercli +28 -0
  64. package/karnel/tools/ai/qoder/helper/qoder_helper.c +47 -0
  65. package/karnel/tools/ai/qoder/install.sh +367 -0
  66. package/karnel/tools/ai/qwen-code/install.sh +0 -0
  67. package/karnel/tools/auto/all.sh +1 -1
  68. package/karnel/tools/auto/n8n/install.sh +0 -0
  69. package/karnel/tools/db/all.sh +1 -1
  70. package/karnel/tools/db/mariadb/install.sh +0 -0
  71. package/karnel/tools/db/mongodb/install.sh +0 -0
  72. package/karnel/tools/db/postgresql/install.sh +0 -0
  73. package/karnel/tools/db/sqlite/install.sh +0 -0
  74. package/karnel/tools/deploy/all.sh +2 -2
  75. package/karnel/tools/deploy/netlify/install.sh +0 -0
  76. package/karnel/tools/deploy/railway/install.sh +1 -1
  77. package/karnel/tools/deploy/vercel/install.sh +0 -0
  78. package/karnel/tools/dev/all.sh +36 -13
  79. package/karnel/tools/dev/bat/install.sh +0 -0
  80. package/karnel/tools/dev/bc/install.sh +0 -0
  81. package/karnel/tools/dev/cloudflared/install.sh +0 -0
  82. package/karnel/tools/dev/curl/install.sh +0 -0
  83. package/karnel/tools/dev/fzf/install.sh +36 -9
  84. package/karnel/tools/dev/gh/install.sh +0 -0
  85. package/karnel/tools/dev/html2text/install.sh +0 -0
  86. package/karnel/tools/dev/imagemagick/install.sh +0 -0
  87. package/karnel/tools/dev/jq/install.sh +0 -0
  88. package/karnel/tools/dev/lsd/install.sh +0 -0
  89. package/karnel/tools/dev/make/install.sh +0 -0
  90. package/karnel/tools/dev/ncurses/install.sh +0 -0
  91. package/karnel/tools/dev/proot/install.sh +0 -0
  92. package/karnel/tools/dev/shfmt/install.sh +0 -0
  93. package/karnel/tools/dev/snyk/install.sh +0 -0
  94. package/karnel/tools/dev/tmate/install.sh +0 -0
  95. package/karnel/tools/dev/translate/install.sh +0 -0
  96. package/karnel/tools/dev/tree/install.sh +0 -0
  97. package/karnel/tools/dev/udocker/install.sh +0 -0
  98. package/karnel/tools/dev/wget/install.sh +0 -0
  99. package/karnel/tools/editor/all.sh +1 -1
  100. package/karnel/tools/editor/code-server/install.sh +0 -0
  101. package/karnel/tools/games/all.sh +1 -1
  102. package/karnel/tools/games/arcade/install.sh +0 -0
  103. package/karnel/tools/games/buzz/install.sh +0 -0
  104. package/karnel/tools/games/ctfgod/install.sh +0 -0
  105. package/karnel/tools/games/detective/install.sh +0 -0
  106. package/karnel/tools/games/pet-friends/install.sh +0 -0
  107. package/karnel/tools/games/tamagotchi/install.sh +0 -0
  108. package/karnel/tools/lang/all.sh +2 -1
  109. package/karnel/tools/lang/bun/bin/bun +27 -0
  110. package/karnel/tools/lang/bun/install.sh +318 -0
  111. package/karnel/tools/lang/bun/src/bun-shim.c +352 -0
  112. package/karnel/tools/lang/bun/src/bun_wrapper.c +55 -0
  113. package/karnel/tools/lang/clang/install.sh +0 -0
  114. package/karnel/tools/lang/golang/install.sh +0 -0
  115. package/karnel/tools/lang/nodejs/install.sh +0 -0
  116. package/karnel/tools/lang/perl/install.sh +0 -0
  117. package/karnel/tools/lang/php/install.sh +0 -0
  118. package/karnel/tools/lang/python/install.sh +0 -0
  119. package/karnel/tools/lang/rust/install.sh +0 -0
  120. package/karnel/tools/network/all.sh +65 -0
  121. package/karnel/tools/network/dark/README.md +45 -0
  122. package/karnel/tools/network/dark/dark.py +709 -0
  123. package/karnel/tools/network/dark/install.sh +51 -0
  124. package/karnel/tools/network/dedsec-network/README.md +42 -0
  125. package/karnel/tools/network/dedsec-network/dedsec-network.py +709 -0
  126. package/karnel/tools/network/dedsec-network/install.sh +50 -0
  127. package/karnel/tools/npm/all.sh +1 -1
  128. package/karnel/tools/npm/live-server/install.sh +0 -0
  129. package/karnel/tools/npm/localtunnel/install.sh +0 -0
  130. package/karnel/tools/npm/markserv/install.sh +0 -0
  131. package/karnel/tools/npm/ncu/install.sh +0 -0
  132. package/karnel/tools/npm/nestjs/install.sh +0 -0
  133. package/karnel/tools/npm/ngrok/install.sh +0 -0
  134. package/karnel/tools/npm/prettier/install.sh +0 -0
  135. package/karnel/tools/npm/psqlformat/install.sh +0 -0
  136. package/karnel/tools/npm/turbopack/install.sh +2 -0
  137. package/karnel/tools/npm/typescript/install.sh +0 -0
  138. package/karnel/tools/npm/vercel/install.sh +0 -0
  139. package/karnel/tools/osint/all.sh +65 -0
  140. package/karnel/tools/osint/robin/README.md +99 -0
  141. package/karnel/tools/osint/robin/common.sh +258 -0
  142. package/karnel/tools/osint/robin/install.sh +548 -0
  143. package/karnel/tools/osint/robin/requirements-termux.txt +33 -0
  144. package/karnel/tools/shell/all.sh +1 -1
  145. package/karnel/tools/shell/better-npm/install.sh +0 -0
  146. package/karnel/tools/shell/fzf-tab/install.sh +0 -0
  147. package/karnel/tools/shell/history-substring/install.sh +0 -0
  148. package/karnel/tools/shell/powerlevel10k/install.sh +0 -0
  149. package/karnel/tools/shell/you-should-use/install.sh +0 -0
  150. package/karnel/tools/shell/zsh-autopair/install.sh +0 -0
  151. package/karnel/tools/shell/zsh-autosuggestions/install.sh +0 -0
  152. package/karnel/tools/shell/zsh-completions/install.sh +0 -0
  153. package/karnel/tools/shell/zsh-defer/install.sh +0 -0
  154. package/karnel/tools/shell/zsh-syntax-highlighting/install.sh +0 -0
  155. package/karnel/tools/ui/all.sh +1 -1
  156. package/karnel/tools/ui/banner/install.sh +0 -0
  157. package/karnel/tools/ui/cursor/install.sh +0 -0
  158. package/karnel/tools/ui/extra-keys/install.sh +0 -0
  159. package/karnel/tools/ui/font/install.sh +0 -0
  160. package/karnel/tools/utils/all.sh +88 -0
  161. package/karnel/tools/utils/applaunch/README.md +43 -0
  162. package/karnel/tools/{dev → utils}/applaunch/install.sh +3 -3
  163. package/karnel/tools/utils/fconv/README.md +41 -0
  164. package/karnel/tools/{dev → utils}/fconv/install.sh +3 -3
  165. package/karnel/tools/utils/filecheck/README.md +41 -0
  166. package/karnel/tools/{dev → utils}/filecheck/install.sh +3 -3
  167. package/karnel/tools/utils/httptmux/README.md +42 -0
  168. package/karnel/tools/{dev → utils}/httptmux/install.sh +0 -0
  169. package/karnel/tools/utils/notes/README.md +41 -0
  170. package/karnel/tools/{dev → utils}/notes/install.sh +3 -3
  171. package/karnel/tools/utils/passman/README.md +42 -0
  172. package/karnel/tools/{dev → utils}/passman/install.sh +3 -3
  173. package/karnel/tools/utils/qrcode/README.md +41 -0
  174. package/karnel/tools/utils/qrcode/install.sh +50 -0
  175. package/karnel/tools/utils/qrcode/qrcode.py +89 -0
  176. package/karnel/tools/utils/splash/README.md +41 -0
  177. package/karnel/tools/{dev → utils}/splash/install.sh +3 -3
  178. package/karnel/tools/utils/treex/README.md +41 -0
  179. package/karnel/tools/{dev → utils}/treex/install.sh +3 -3
  180. package/karnel/tools/utils/websites/README.md +41 -0
  181. package/karnel/tools/{dev → utils}/websites/install.sh +3 -3
  182. package/karnel/tools/utils/zork/README.md +43 -0
  183. package/karnel/tools/{dev → utils}/zork/install.sh +3 -3
  184. package/karnel/utils/banner.sh +8 -6
  185. package/karnel/utils/bootstrap.sh +1 -1
  186. package/karnel/utils/env.sh +16 -2
  187. package/karnel/utils/log.sh +0 -1
  188. package/karnel/utils/tools.sh +9 -2
  189. package/package.json +6 -1
  190. package/scripts/check-package.js +45 -0
  191. package/scripts/completion.bash +8 -3
  192. package/scripts/completion.zsh +8 -13
  193. package/karnel/cli/commands/doctor/system.sh +0 -87
  194. package/karnel/tools/dev/applaunch/__pycache__/applaunch.cpython-314.pyc +0 -0
  195. package/karnel/tools/dev/fconv/__pycache__/fconv.cpython-314.pyc +0 -0
  196. package/karnel/tools/dev/filecheck/__pycache__/filecheck.cpython-314.pyc +0 -0
  197. package/karnel/tools/dev/notes/__pycache__/notes.cpython-314.pyc +0 -0
  198. package/karnel/tools/dev/passman/__pycache__/passman.cpython-314.pyc +0 -0
  199. package/karnel/tools/dev/splash/__pycache__/splash.cpython-314.pyc +0 -0
  200. package/karnel/tools/dev/websites/__pycache__/websites.cpython-314.pyc +0 -0
  201. package/karnel/tools/games/arcade/__pycache__/arcade.cpython-314.pyc +0 -0
  202. package/karnel/tools/games/buzz/__pycache__/buzz.cpython-314.pyc +0 -0
  203. package/karnel/tools/games/ctfgod/__pycache__/ctfgod.cpython-314.pyc +0 -0
  204. package/karnel/tools/games/detective/__pycache__/detective.cpython-314.pyc +0 -0
  205. package/karnel/tools/games/pet-friends/__pycache__/pet-friends.cpython-314.pyc +0 -0
  206. package/karnel/tools/games/tamagotchi/__pycache__/tamagotchi.cpython-314.pyc +0 -0
  207. package/karnel/tools/games/terminal-arcade/__pycache__/terminal-arcade.cpython-314.pyc +0 -0
  208. /package/karnel/tools/{dev → utils}/applaunch/applaunch.py +0 -0
  209. /package/karnel/tools/{dev → utils}/fconv/fconv.py +0 -0
  210. /package/karnel/tools/{dev → utils}/filecheck/filecheck.py +0 -0
  211. /package/karnel/tools/{dev → utils}/notes/notes.py +0 -0
  212. /package/karnel/tools/{dev → utils}/passman/passman.py +0 -0
  213. /package/karnel/tools/{dev → utils}/splash/splash.py +0 -0
  214. /package/karnel/tools/{dev → utils}/treex/treex.py +0 -0
  215. /package/karnel/tools/{dev → utils}/websites/websites.py +0 -0
@@ -11,6 +11,7 @@ start_main() {
11
11
  log_info "Usage: karnel start <target>"
12
12
  echo
13
13
  list_item "editor - Start code-server (VS Code in browser)"
14
+ list_item "robin - Start Tor + Robin on 127.0.0.1:8501"
14
15
  echo
15
16
  return
16
17
  fi
@@ -22,6 +23,10 @@ start_main() {
22
23
  editor)
23
24
  _start_editor "$@"
24
25
  ;;
26
+ robin)
27
+ import "@/cli/commands/robin"
28
+ robin_main start "$@"
29
+ ;;
25
30
  *)
26
31
  log_warn "Unknown start target: $target"
27
32
  log_info "Run 'karnel start' to see available targets"
@@ -38,6 +43,11 @@ _start_editor() {
38
43
 
39
44
  local port="${1:-8080}"
40
45
 
46
+ if ! [[ "$port" =~ ^[0-9]+$ ]] || (( port < 1024 || port > 65535 )); then
47
+ log_error "Invalid port: $port (must be between 1024 and 65535)"
48
+ return 1
49
+ fi
50
+
41
51
  echo
42
52
  box "Starting code-server"
43
53
  echo
@@ -45,10 +55,10 @@ _start_editor() {
45
55
  log_info "Port: $port"
46
56
  log_info "Password set via --auth password flag"
47
57
  echo
48
- log_success "Open http://localhost:$port in your browser"
58
+ log_success "Open http://127.0.0.1:$port in your browser"
49
59
  echo
50
60
  log_info "Press Ctrl+C to stop"
51
61
  echo
52
62
 
53
- code-server . --bind-addr "0.0.0.0:$port" --auth password
63
+ code-server . --bind-addr "127.0.0.1:$port" --auth password
54
64
  }
@@ -62,6 +62,17 @@ status_main() {
62
62
  services+=("omni-route")
63
63
  fi
64
64
 
65
+ # Robin OSINT
66
+ import "@/tools/osint/robin/common"
67
+ if [[ -d "$ROBIN_APP_DIR/.git" ]]; then
68
+ if _robin_managed_process_running && _robin_http_healthy; then
69
+ log_success "Robin: RUNNING (127.0.0.1:$ROBIN_PORT)"
70
+ services+=("robin")
71
+ else
72
+ log_info "Robin: installed, not started"
73
+ fi
74
+ fi
75
+
65
76
  # Internet
66
77
  if command -v ping &>/dev/null; then
67
78
  if timeout 3 ping -c 1 -W 3 8.8.8.8 &>/dev/null; then
@@ -24,6 +24,12 @@ uninstall_main() {
24
24
  list_item "shell - Remove ZSH + Oh My Zsh"
25
25
  list_item "ui - Restore Termux UI to default"
26
26
  list_item "auto - Remove automation tools"
27
+ list_item "network - Remove network tools"
28
+ list_item "utils - Remove utility scripts"
29
+ list_item "games - Remove games"
30
+ list_item "deploy - Remove deploy CLIs"
31
+ list_item "voice - Remove voice command"
32
+ list_item "osint - Remove OSINT tools"
27
33
  echo
28
34
  log_info "Uninstall specific tools with flags:"
29
35
  echo
@@ -39,6 +45,7 @@ uninstall_main() {
39
45
  # Separate module target from tool flags
40
46
  local module_target=""
41
47
  local -a tool_flags=()
48
+ local -a invalid_args=()
42
49
 
43
50
  for arg in "$@"; do
44
51
  if [[ "$arg" == --* ]]; then
@@ -46,9 +53,21 @@ uninstall_main() {
46
53
  tool_flags+=("$flag")
47
54
  elif [[ -z "$module_target" ]]; then
48
55
  module_target="$arg"
56
+ else
57
+ invalid_args+=("$arg")
49
58
  fi
50
59
  done
51
60
 
61
+ # If there are invalid arguments, show error and abort
62
+ if [[ ${#invalid_args[@]} -gt 0 ]]; then
63
+ log_error "Invalid arguments: ${invalid_args[*]}"
64
+ echo
65
+ log_info "To uninstall specific tools, use -- before the name:"
66
+ log_info " ${D_CYAN}karnel uninstall $module_target --${invalid_args[0]}${NC}"
67
+ echo
68
+ return 1
69
+ fi
70
+
52
71
  # If no module target specified, show error
53
72
  if [[ -z "$module_target" ]]; then
54
73
  log_error "No target specified"
@@ -106,6 +125,30 @@ _uninstall_full_module() {
106
125
  import "@/modules/auto"
107
126
  uninstall_auto
108
127
  ;;
128
+ osint)
129
+ import "@/modules/osint"
130
+ uninstall_osint
131
+ ;;
132
+ network)
133
+ import "@/modules/network"
134
+ uninstall_network
135
+ ;;
136
+ utils)
137
+ import "@/modules/utils"
138
+ uninstall_utils
139
+ ;;
140
+ games)
141
+ import "@/tools/games/all"
142
+ uninstall_all_games
143
+ ;;
144
+ deploy)
145
+ import "@/modules/deploy"
146
+ uninstall_deploy
147
+ ;;
148
+ voice)
149
+ import "@/modules/voice"
150
+ uninstall_voice
151
+ ;;
109
152
  *)
110
153
  log_warn "Unknown uninstall target: $target"
111
154
  echo "Run 'karnel uninstall' to see available targets"
@@ -116,5 +159,9 @@ _uninstall_full_module() {
116
159
  _uninstall_specific_tools() {
117
160
  local module="$1"
118
161
  shift
162
+ if [[ "$module" == "osint" ]]; then
163
+ import "@/tools/osint/robin/common"
164
+ _robin_print_disclaimer
165
+ fi
119
166
  _batch_tool_action "$module" "uninstall" "$@"
120
167
  }
@@ -25,6 +25,12 @@ update_main() {
25
25
  list_item "shell - Update ZSH plugins"
26
26
  list_item "ui - Update Termux UI"
27
27
  list_item "auto - Update Automation Tools"
28
+ list_item "network - Update network tools"
29
+ list_item "utils - Update utility scripts"
30
+ list_item "games - Update games"
31
+ list_item "deploy - Update deploy CLIs"
32
+ list_item "voice - Update voice command"
33
+ list_item "osint - Update OSINT tools"
28
34
  echo
29
35
  log_info "Update specific tools with flags:"
30
36
  echo
@@ -38,6 +44,7 @@ update_main() {
38
44
  # Separate module target from tool flags
39
45
  local module_target=""
40
46
  local -a tool_flags=()
47
+ local -a invalid_args=()
41
48
 
42
49
  for arg in "$@"; do
43
50
  if [[ "$arg" == --* ]]; then
@@ -45,9 +52,21 @@ update_main() {
45
52
  tool_flags+=("$flag")
46
53
  elif [[ -z "$module_target" ]]; then
47
54
  module_target="$arg"
55
+ else
56
+ invalid_args+=("$arg")
48
57
  fi
49
58
  done
50
59
 
60
+ # If there are invalid arguments, show error and abort
61
+ if [[ ${#invalid_args[@]} -gt 0 ]]; then
62
+ log_error "Invalid arguments: ${invalid_args[*]}"
63
+ echo
64
+ log_info "To update specific tools, use -- before the name:"
65
+ log_info " ${D_CYAN}karnel update $module_target --${invalid_args[0]}${NC}"
66
+ echo
67
+ return 1
68
+ fi
69
+
51
70
  # If no module target specified, show error
52
71
  if [[ -z "$module_target" ]]; then
53
72
  log_error "No target specified"
@@ -112,6 +131,26 @@ _update_full_module() {
112
131
  import "@/tools/games/all"
113
132
  update_all_games
114
133
  ;;
134
+ osint)
135
+ import "@/modules/osint"
136
+ update_osint
137
+ ;;
138
+ network)
139
+ import "@/modules/network"
140
+ update_network
141
+ ;;
142
+ utils)
143
+ import "@/modules/utils"
144
+ update_utils
145
+ ;;
146
+ deploy)
147
+ import "@/modules/deploy"
148
+ update_deploy
149
+ ;;
150
+ voice)
151
+ import "@/modules/voice"
152
+ update_voice
153
+ ;;
115
154
  *)
116
155
  log_warn "Unknown update target: $target"
117
156
  echo "Run 'karnel update' to see available targets"
@@ -123,6 +162,10 @@ _update_full_module() {
123
162
  _update_specific_tools() {
124
163
  local module="$1"
125
164
  shift
165
+ if [[ "$module" == "osint" ]]; then
166
+ import "@/tools/osint/robin/common"
167
+ _robin_print_disclaimer
168
+ fi
126
169
  _batch_tool_action "$module" "update" "$@"
127
170
  }
128
171
 
@@ -1,3 +1,5 @@
1
+ #!/usr/bin/env bash
2
+
1
3
  version_main() {
2
4
  echo "$KARNEL_VERSION"
3
5
  }
@@ -52,14 +52,13 @@ voice_help() {
52
52
  }
53
53
 
54
54
  voice_main() {
55
- local agent="${1:-}"
56
55
  local lang=""
57
56
  local skip_edit=false
58
57
  local no_clip=false
59
58
  local extra_args=()
60
- local parsed=false
59
+ local agent=""
61
60
 
62
- # Parse options before agent
61
+ # Parse all arguments: flags can appear anywhere
63
62
  while [[ $# -gt 0 ]]; do
64
63
  case "$1" in
65
64
  --lang) lang="${2:-}"; shift 2 ;;
@@ -67,14 +66,20 @@ voice_main() {
67
66
  --no-clip) no_clip=true; shift ;;
68
67
  --help|-h) voice_help; return ;;
69
68
  --) shift; break ;;
70
- *) break ;;
69
+ -*)
70
+ log_warn "Unknown option: $1"
71
+ shift
72
+ ;;
73
+ *)
74
+ [[ -z "$agent" ]] && agent="$1"
75
+ shift
76
+ ;;
71
77
  esac
72
78
  done
73
79
 
74
- agent="${1:-}"
75
80
  [[ -z "$agent" ]] && { voice_help; return; }
76
81
 
77
- if [[ -z "$agent" ]] || [[ "$agent" == "--help" ]] || [[ "$agent" == "-h" ]]; then
82
+ if [[ "$agent" == "--help" ]] || [[ "$agent" == "-h" ]]; then
78
83
  voice_help
79
84
  return
80
85
  fi