gloo-cli 1.4 → 1.5
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.
- checksums.yaml +4 -4
- data/lib/shell.rb +8 -1
- data/lib/shell_runner.rb +16 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2a167c3410e526f3dec9aa9f07c430eefd8cd031c07820bd44afa9fccd90673e
|
|
4
|
+
data.tar.gz: 9addba3dafc9ce19639752a608051c58b9d0d521bf4105bfa5ed8272e92146cc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 266e4236bf6f3abd8d5baf20859262eacb7b109da6cce66789587d6d17e4b4b9aed2e7e70d5ebd4a69868868c8fa2636cbb5c68d1265668eb15dff63121c08f5
|
|
7
|
+
data.tar.gz: 4e47277e9afaf8b01a9cd00312d2ba8bd9b9457705db97acccc8ef323ff09a260aabe6668fdd235c4684d4bdfca48421c3ba32def50343c5f270c8c70987633a
|
data/lib/shell.rb
CHANGED
|
@@ -98,6 +98,8 @@ class Shell < Gloo::Core::Obj
|
|
|
98
98
|
|
|
99
99
|
#
|
|
100
100
|
# Start the shell.
|
|
101
|
+
# If CLI args were passed, execute that command once and return.
|
|
102
|
+
# Otherwise, enter the interactive REPL.
|
|
101
103
|
#
|
|
102
104
|
def msg_start
|
|
103
105
|
runner = get_runner
|
|
@@ -105,7 +107,12 @@ class Shell < Gloo::Core::Obj
|
|
|
105
107
|
# add_test_commands
|
|
106
108
|
add_quit_command
|
|
107
109
|
|
|
108
|
-
|
|
110
|
+
cmd_tokens = @engine.args.files
|
|
111
|
+
if cmd_tokens.any?
|
|
112
|
+
runner.execute_once( cmd_tokens )
|
|
113
|
+
else
|
|
114
|
+
runner.start
|
|
115
|
+
end
|
|
109
116
|
end
|
|
110
117
|
|
|
111
118
|
#
|
data/lib/shell_runner.rb
CHANGED
|
@@ -184,7 +184,22 @@ class ShellRunner
|
|
|
184
184
|
# REPL
|
|
185
185
|
# ---------------------------------------------------------------------
|
|
186
186
|
|
|
187
|
-
#
|
|
187
|
+
#
|
|
188
|
+
# Execute a single command from the given tokens and return.
|
|
189
|
+
# Used when a command is passed directly from the CLI.
|
|
190
|
+
#
|
|
191
|
+
def execute_once( tokens )
|
|
192
|
+
result = traverse( @root, tokens )
|
|
193
|
+
if result[:node]
|
|
194
|
+
@obj.run_before_action
|
|
195
|
+
execute_command( result[:node], tokens, result[:parent] )
|
|
196
|
+
@obj.run_after_action
|
|
197
|
+
else
|
|
198
|
+
handle_unknown_command
|
|
199
|
+
end
|
|
200
|
+
end
|
|
201
|
+
|
|
202
|
+
#
|
|
188
203
|
# Traverse the command tree to find the matching node
|
|
189
204
|
#
|
|
190
205
|
# @param node [CommandNode] The current node
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: gloo-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: '1.
|
|
4
|
+
version: '1.5'
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Eric Crane
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-06-
|
|
11
|
+
date: 2026-06-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Adds CLI support to Gloo.
|
|
14
14
|
email:
|