Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
Aethyr
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aethyr
Aethyr
Commits
d5dc40e4
Commit
d5dc40e4
authored
6 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
improved output of help command
parent
07f5f26a
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
lib/aethyr/core/commands/help_handler.rb
+7
-9
7 additions, 9 deletions
lib/aethyr/core/commands/help_handler.rb
lib/aethyr/core/objects/player.rb
+2
-1
2 additions, 1 deletion
lib/aethyr/core/objects/player.rb
lib/aethyr/core/render/display.rb
+1
-1
1 addition, 1 deletion
lib/aethyr/core/render/display.rb
with
10 additions
and
11 deletions
lib/aethyr/core/commands/help_handler.rb
+
7
−
9
View file @
d5dc40e4
...
@@ -4,25 +4,23 @@ module Aethyr
...
@@ -4,25 +4,23 @@ module Aethyr
module
Extend
module
Extend
module
HandleHelp
module
HandleHelp
attr_reader
:commands
attr_reader
:commands
def
initialize
(
player
,
commands
,
*
args
)
def
initialize
(
player
,
commands
,
*
args
)
super
(
player
,
*
args
)
super
(
player
,
*
args
)
@commands
=
commands
@commands
=
commands
end
end
def
player_input
(
data
)
def
player_input
(
data
)
super
(
data
)
super
(
data
)
case
data
[
:input
]
case
data
[
:input
]
when
/^(help|help topics)$/i
when
/^(help|help topics)$/i
if
self
.
can_help?
if
self
.
can_help?
self
.
commands
.
each
do
|
command
|
self
.
player
.
output
(
commands
.
join
(
" "
)
+
" "
,
true
)
self
.
player
.
output
command
end
end
end
end
end
end
end
def
can_help?
def
can_help?
true
true
end
end
...
@@ -30,10 +28,10 @@ module Aethyr
...
@@ -30,10 +28,10 @@ module Aethyr
class
HelpHandler
class
HelpHandler
include
Aethyr
::
Extend
::
HandleHelp
include
Aethyr
::
Extend
::
HandleHelp
def
initialize
(
player
,
commands
,
*
args
)
def
initialize
(
player
,
commands
,
*
args
)
super
super
end
end
end
end
end
end
end
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
lib/aethyr/core/objects/player.rb
+
2
−
1
View file @
d5dc40e4
...
@@ -181,9 +181,10 @@ class Player < LivingObject
...
@@ -181,9 +181,10 @@ class Player < LivingObject
end
end
clean_input
=
input
.
downcase
.
strip
clean_input
=
input
.
downcase
.
strip
self
.
output
(
'
Help topics available:
'
)
if
(
clean_input
.
eql?
"help"
)
or
(
clean_input
.
eql?
"help topics"
)
self
.
output
(
"
Help topics available:
"
,
false
)
if
(
clean_input
.
eql?
"help"
)
or
(
clean_input
.
eql?
"help topics"
)
broadcast
(
:player_input
,
{
:publisher
=>
self
,
:input
=>
input
})
broadcast
(
:player_input
,
{
:publisher
=>
self
,
:input
=>
input
})
event
=
CommandParser
.
parse
(
self
,
input
)
event
=
CommandParser
.
parse
(
self
,
input
)
self
.
output
(
" "
,
false
)
if
(
clean_input
.
eql?
"help"
)
or
(
clean_input
.
eql?
"help topics"
)
if
event
.
nil?
if
event
.
nil?
if
input
if
input
...
...
This diff is collapsed.
Click to expand it.
lib/aethyr/core/render/display.rb
+
1
−
1
View file @
d5dc40e4
...
@@ -266,7 +266,7 @@ class Display
...
@@ -266,7 +266,7 @@ class Display
message
<<
"
\r\n
"
message
<<
"
\r\n
"
end
end
end
end
send
(
message
,
message_type:
message_type
)
send
(
message
,
message_type:
message_type
,
add_newline:
newline
)
end
end
def
paginate
message
def
paginate
message
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment