Skip to content

Commit d12681e

Browse files
committed
Ok, it should *actually* work now (without explicit "open" argument)
1 parent 9350508 commit d12681e

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

bin/devhints

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,20 @@ if help_commands.any? { |cmd| ARGV.include? cmd }
5151
end
5252
end
5353

54+
cli_commands = help_commands
55+
MyCLI.commands.each do |hash|
56+
unless cli_commands.include?(hash)
57+
cli_commands << hash[0]
58+
end
59+
end
60+
MyCLI.map.keys.each do |option|
61+
unless cli_commands.include?(option)
62+
cli_commands << option
63+
end
64+
end
65+
66+
if (ARGV & cli_commands).empty?
67+
ARGV.insert(0, MyCLI.default_task)
68+
end
69+
5470
MyCLI.start(ARGV)

devhints.gemspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Gem::Specification.new do |s|
22
s.name = 'devhints'
3-
s.version = '0.1.1'
3+
s.version = '0.1.2'
44
s.summary = "A CLI for devhints.io"
55
s.description = "This is a simple gem that checkes whether a cheat sheet for something exists at devhints.io, then opens it in a web browser if it does."
66
s.authors = ["Jack MapelLentz"]

0 commit comments

Comments
 (0)