Class: SocialSnippet::CommandLine::SSpm::SubCommands::CompleteCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/social_snippet/command_line/sspm/sub_commands/complete_command.rb

Instance Attribute Summary

Attributes inherited from Command

#args, #input_stream, #opt_parser, #options, #output_stream, #streams, #tokens

Instance Method Summary collapse

Methods inherited from Command

#define_option, #init, #initialize, #social_snippet

Constructor Details

This class inherits a constructor from SocialSnippet::CommandLine::Command

Instance Method Details

#define_optionsObject


15
16
# File 'lib/social_snippet/command_line/sspm/sub_commands/complete_command.rb', line 15

def define_options
end

#descObject


11
12
13
# File 'lib/social_snippet/command_line/sspm/sub_commands/complete_command.rb', line 11

def desc
  "Complete snippet paths (for editor plugins)"
end

#runObject


18
19
20
21
22
23
24
# File 'lib/social_snippet/command_line/sspm/sub_commands/complete_command.rb', line 18

def run
  if has_next_token?
    social_snippet.api.cli_complete_snippet_path next_token
  else
    help
  end
end

#usageObject


5
6
7
8
9
# File 'lib/social_snippet/command_line/sspm/sub_commands/complete_command.rb', line 5

def usage
  <<EOF
Usage: sspm complete [options] [--] <keyword>
EOF
end