Skip to content

Commit

Permalink
✨ GitHub CLI style headers
Browse files Browse the repository at this point in the history
  • Loading branch information
binaryben committed Oct 24, 2022
1 parent 4975695 commit a4f3da3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion source/commands/config.nim
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const
"help": "CLIGEN-NOHELP",
"version": "CLIGEN-NOHELP",
}.toTable()
ConfigUsage * = "ssh-keys $command <section.key> <value>\n\nOPTIONS\n$options"
ConfigUsage * = "ssh-keys $command <section.key> <value>\n\n\e[1mOPTIONS\e[m\n$options"

proc configCommand * (
file: string = getConfPath(),
Expand Down
19 changes: 12 additions & 7 deletions source/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,30 @@ import
commands/sync,
utils/paths

const GlobalUsage = """${doc}USAGE
const GlobalUsage = "${doc}\e[1mUSAGE\e[m\n" & """
$command <command> [flags] [args]
COMMANDS
""" & "\e[1mCOMMANDS\e[m" & """
$subcmds
FLAGS
""" & "\e[1mFLAGS\e[m" & """
--help Show help for a command
--version Show ssh-keys version
EXAMPLES
""" & "\e[1mEXAMPLES\e[m" & """
λ $command install
λ $command add --user=binaryben
λ $command sync
LEARN MORE
""" & "\e[1mLEARN MORE\e[m" & """
Use '$command help <command>' for more information about a command
Read the docs at https://github.com/binaryben/sync-ssh-keys
FEEDBACK
""" & "\e[1mFEEDBACK\e[m" & """
Open an issue at https://bnry.be/ssk-issues
Request help at https://bnry.be/ssk-help
Submit feature requests at https://bnry.be/ssk-idea"""
Expand All @@ -49,7 +54,7 @@ when isMainModule:

clCfg.helpSyntax = ""
clCfg.hTabCols = @[ clOptKeys, clDescrip ]
clCfg.useHdr = "${doc}\n*USAGE*\n "
clCfg.useHdr = "${doc}\n\e[1mUSAGE\e[m\n "

dispatchMulti(
[ "multi", cmdName=binName, doc=docLine, usage=GlobalUsage ],
Expand Down

0 comments on commit a4f3da3

Please sign in to comment.