Module: Fjords::Cli::Usage

Included in:
Core
Defined in:
lib/fjords/cli/usage.rb

Instance Method Summary collapse

Instance Method Details

#basic_usageObject



24
25
26
27
# File 'lib/fjords/cli/usage.rb', line 24

def basic_usage
  "Usage: fjords [options] command [<args>] [command_options]\n" +
  "Try 'fjords help [command]' or 'fjords help options' for more information."
end

#command_usageObject



29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/fjords/cli/usage.rb', line 29

def command_usage
  # nameservers      List the nameservers for using a root domain
  "\n\#{basic_usage}\n\nCurrently available af commands are:\n\nGetting Started\n  login               Login to Fjords\n  logout              Logout of Fjords\n  signup              Create an account\n  info                Get your account information, including costs\n\nSites\n  sites               List deployed sites\n  site:details DOMAIN Information about a specific domain\n  remove DOMAIN       Remove a deployed site\n\nSite Features\n  cdn:enable DOMAIN   Enable the Content Delivery Network\n  cdn:disable DOMAIN  Disable the Content Delivery Network\n  gzip:enable DOMAIN  Enable Gzipping of assets (HTML, CSS, JS)\n  gzip:disable DOMAIN Disable Gzipping of assets (HTML, CSS, JS)\n\nSite Creation\n  push                Push a new site\n\nHelp\n  help [command]      Get general help or help on a specific command\n  help options        Get help on available options\n  bugreport           Send a bug-report\n"

end

#display_usageObject



12
13
14
15
16
17
18
19
20
21
22
# File 'lib/fjords/cli/usage.rb', line 12

def display_usage
  if @usage
    puts @usage_error if @usage_error
    puts "Usage: #{@usage}"
    return
  elsif @verb_usage
    puts @verb_usage
    return
  end
  puts command_usage
end

#usage(msg = nil) ⇒ Object



2
3
4
5
# File 'lib/fjords/cli/usage.rb', line 2

def usage(msg = nil)
  @usage = msg if msg
  @usage
end

#usage_error(msg = nil) ⇒ Object



7
8
9
10
# File 'lib/fjords/cli/usage.rb', line 7

def usage_error(msg = nil)
  @usage_error = msg if msg
  @usage_error
end