doc: Change help banner

This commit is contained in:
Glenn Y. Rolland 2022-08-15 17:08:01 +02:00
parent 4317ae77b5
commit c75624c249
2 changed files with 10 additions and 9 deletions

View file

@ -6,11 +6,10 @@ require "xdg_basedir"
require "completion" require "completion"
require "log" require "log"
require "../lib/version"
require "../lib/types"
require "../lib/models"
require "../lib/actions" require "../lib/actions"
require "../lib/models" require "../lib/models"
require "../lib/types"
require "../lib/version"
module Hodler module Hodler
class CtlCli class CtlCli
@ -31,7 +30,7 @@ module Hodler
# parse # parse
OptionParser.parse(args) do |parser| OptionParser.parse(args) do |parser|
parser.banner = "Usage: #{Version::PROGRAM} [options] [commands] [arguments]" parser.banner = "Usage: #{Version::PROGRAM_HODLERCTL} [options] [commands] [arguments]"
parser.separator parser.separator
parser.separator "Options" parser.separator "Options"
@ -57,24 +56,23 @@ module Hodler
parser.on "--completion", "Provide autocompletion for bash" do parser.on "--completion", "Provide autocompletion for bash" do
# nothing here # nothing here
end end
complete_with Version::PROGRAM, parser
parser.separator parser.separator
parser.separator "Commands" parser.separator "Commands"
parser.on("get", "Get given object") do parser.on("get", "Get given object") do
parser.banner = "Usage: #{Version::PROGRAM} get [arguments]" parser.banner = "Usage: #{Version::PROGRAM_HODLERCTL} get [arguments]"
parser.separator parser.separator
parser.separator "Commands" parser.separator "Commands"
parser.on("portfolio", "Show current portfolio") do parser.on("portfolio", "Show current portfolio") do
parser.banner = "Usage: #{Version::PROGRAM} portfolio [arguments]" parser.banner = "Usage: #{Version::PROGRAM_HODLERCTL} portfolio [arguments]"
action = GetPortfolioAction action = GetPortfolioAction
end end
parser.on("wallet", "Show given wallet") do parser.on("wallet", "Show given wallet") do
parser.banner = "Usage: #{Version::PROGRAM} portfolio [arguments]" parser.banner = "Usage: #{Version::PROGRAM_HODLERCTL} portfolio [arguments]"
action = GetWalletAction action = GetWalletAction
end end
end end
@ -112,6 +110,7 @@ module Hodler
exit(1) exit(1)
end end
complete_with Version::PROGRAM_HODLERCTL, parser
end end
return { return {

View file

@ -1,7 +1,9 @@
module Hodler module Hodler
class Version class Version
PROGRAM = "hodler" PROGRAM_HODLERCTL = "hodlerctl"
PROGRAM_HODLERTUI = "hodlertui"
PROGRAM_HODLERWEB = "hodlerweb"
VERSION = "0.1.0" VERSION = "0.1.0"
end end
end end