Skip to content

Commit b6eba62

Browse files
committed
Minor updates, new repo gif
1 parent b7248c6 commit b6eba62

File tree

12 files changed

+50
-43
lines changed

12 files changed

+50
-43
lines changed

.github/IMAGES/paymail-inspector.gif

-1.09 MB
Loading

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
# Paymail Inspector
22

3-
[![Go](https://img.shields.io/github/go-mod/go-version/mrz1836/paymail-inspector?v=6)](https://golang.org/)
4-
[![Build Status](https://travis-ci.com/mrz1836/paymail-inspector.svg?branch=master&v=6)](https://travis-ci.com/mrz1836/paymail-inspector)
5-
[![Report](https://goreportcard.com/badge/github.com/mrz1836/paymail-inspector?style=flat&v=6)](https://goreportcard.com/report/github.com/mrz1836/paymail-inspector)
6-
[![Release](https://img.shields.io/github/release-pre/mrz1836/paymail-inspector.svg?style=flat&v=6)](https://github.com/mrz1836/paymail-inspector/releases)
3+
[![Go](https://img.shields.io/github/go-mod/go-version/mrz1836/paymail-inspector?v=7)](https://golang.org/)
4+
[![Build Status](https://travis-ci.com/mrz1836/paymail-inspector.svg?branch=master&v=7)](https://travis-ci.com/mrz1836/paymail-inspector)
5+
[![Report](https://goreportcard.com/badge/github.com/mrz1836/paymail-inspector?style=flat&v=7)](https://goreportcard.com/report/github.com/mrz1836/paymail-inspector)
6+
[![Release](https://img.shields.io/github/release-pre/mrz1836/paymail-inspector.svg?style=flat&v=7)](https://github.com/mrz1836/paymail-inspector/releases)
77
[![GoDoc](https://godoc.org/github.com/mrz1836/paymail-inspector?status.svg&style=flat)](https://pkg.go.dev/github.com/mrz1836/paymail-inspector?tab=subdirectories)
88

99
> **paymail-inspector** is a CLI app for interacting with paymail service providers
1010
11-
<img src=".github/IMAGES/paymail-inspector.gif?raw=true&v=6" alt="Paymail Commands">
11+
<img src=".github/IMAGES/paymail-inspector.gif?raw=true&v=7" alt="Paymail Commands">
1212

1313
## Table of Contents
1414
- [Installation](#installation)

cmd/brfc.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var brfcCmd = &cobra.Command{
2020
Example: applicationName + ` brfc list
2121
` + applicationName + ` brfc search nChain
2222
` + applicationName + ` brfc generate --title "BRFC Specifications" --author "andy (nChain)" --version 1`,
23-
Long: chalk.Green.Color(`
23+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
2424
___. _____
2525
\_ |__________/ ____\____
2626
| __ \_ __ \ __\/ ___\

cmd/capabilities.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var capabilitiesCmd = &cobra.Command{
1717
Use: "capabilities",
1818
Short: "Get the capabilities of the paymail domain",
19-
Long: chalk.Green.Color(`
19+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
2020
___. .__.__ .__ __ .__
2121
____ _____ ___________ \_ |__ |__| | |__|/ |_|__| ____ ______
2222
_/ ___\\__ \ \____ \__ \ | __ \| | | | \ __\ |/ __ \ / ___/

cmd/p2p.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const (
1818
var p2pCmd = &cobra.Command{
1919
Use: "p2p",
2020
Short: "Starts a new P2P payment request",
21-
Long: chalk.Green.Color(`
21+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
2222
________
2323
______ \_____ \______
2424
\____ \ / ____/\____ \

cmd/resolve.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import (
1515
var resolveCmd = &cobra.Command{
1616
Use: "resolve",
1717
Short: "Resolves a paymail address",
18-
Long: chalk.Green.Color(`
18+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
1919
.__
2020
_______ ____ __________ | |___ __ ____
2121
\_ __ \_/ __ \ / ___/ _ \| |\ \/ // __ \

cmd/root.go

Lines changed: 27 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var rootCmd = &cobra.Command{
2727
Use: applicationName,
2828
Short: "Inspect, validate domains or resolve paymail addresses",
2929
Example: applicationName + " -h",
30-
Long: chalk.Green.Color(`
30+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
3131
__________ .__.__ .___ __
3232
\______ \_____ ___.__. _____ _____ |__| | | | ____ ____________ ____ _____/ |_ ___________
3333
| ___/\__ \< | |/ \\__ \ | | | | |/ \ / ___/\____ \_/ __ \_/ ___\ __\/ _ \_ __ \
@@ -70,26 +70,9 @@ func Execute() {
7070
// Run root command
7171
er(rootCmd.Execute())
7272

73-
// Generate docs from all commands
73+
// Generate documentation from all commands
7474
if generateDocs {
75-
76-
// Replace the colorful logs in terminal (displays in Cobra docs) (color numbers generated)
77-
replacer := strings.NewReplacer("[32m", "```", "[33m", "```\n", "[39m", "", "[36m", "", "\u001B", "")
78-
rootCmd.Long = replacer.Replace(rootCmd.Long)
79-
80-
// Loop all command, adjust the Long description, re-add command
81-
for _, command := range rootCmd.Commands() {
82-
rootCmd.RemoveCommand(command)
83-
command.Long = replacer.Replace(command.Long)
84-
rootCmd.AddCommand(command)
85-
}
86-
87-
// Generate the markdown docs
88-
if err := doc.GenMarkdownTree(rootCmd, docsLocation); err != nil {
89-
chalker.Log(chalker.ERROR, fmt.Sprintf("Error generating docs: %s", err.Error()))
90-
return
91-
}
92-
chalker.Log(chalker.SUCCESS, fmt.Sprintf("Successfully generated documentation for %d commands", len(rootCmd.Commands())))
75+
generateDocumentation()
9376
}
9477

9578
// Flush cache?
@@ -177,3 +160,27 @@ func initConfig() {
177160

178161
// chalker.Log(chalker.INFO, fmt.Sprintf("...loaded config file: %s", viper.ConfigFileUsed()))
179162
}
163+
164+
// generateDocumentation will generate all documentation about each command
165+
func generateDocumentation() {
166+
167+
// Replace the colorful logs in terminal (displays in Cobra docs) (color numbers generated)
168+
replacer := strings.NewReplacer("[32m", "```", "[33m", "```\n", "[39m", "", "[22m", "", "[36m", "", "[1m", "", "[40m", "", "[49m", "", "\u001B", "")
169+
rootCmd.Long = replacer.Replace(rootCmd.Long)
170+
171+
// Loop all command, adjust the Long description, re-add command
172+
for _, command := range rootCmd.Commands() {
173+
rootCmd.RemoveCommand(command)
174+
command.Long = replacer.Replace(command.Long)
175+
rootCmd.AddCommand(command)
176+
}
177+
178+
// Generate the markdown docs
179+
if err := doc.GenMarkdownTree(rootCmd, docsLocation); err != nil {
180+
chalker.Log(chalker.ERROR, fmt.Sprintf("Error generating docs: %s", err.Error()))
181+
return
182+
}
183+
184+
// Success
185+
chalker.Log(chalker.SUCCESS, fmt.Sprintf("Successfully generated documentation for %d commands", len(rootCmd.Commands())))
186+
}

cmd/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616
var validateCmd = &cobra.Command{
1717
Use: "validate",
1818
Short: "Validate a paymail address or domain",
19-
Long: chalk.Green.Color(`
19+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
2020
.__ .__ .___ __
2121
___ _______ | | |__| __| _/____ _/ |_ ____
2222
\ \/ /\__ \ | | | |/ __ |\__ \\ __\/ __ \

cmd/verify.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
var verifyCmd = &cobra.Command{
1515
Use: "verify",
1616
Short: "Verifies if a paymail is associated to a pubkey",
17-
Long: chalk.Green.Color(`
17+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
1818
.__ _____
1919
___ __ ___________|__|/ ____\__.__.
2020
\ \/ // __ \_ __ \ \ __< | |

cmd/whois.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var whoisCmd = &cobra.Command{
1919
SuggestFor: []string{"lookup"},
2020
Example: applicationName + ` whois mrz
2121
` + applicationName + ` w mrz`,
22-
Long: chalk.Green.Color(`
22+
Long: chalk.Green.NewStyle().WithTextStyle(chalk.Bold).Style(`
2323
.__ .__
2424
__ _ _| |__ ____ |__| ______
2525
\ \/ \/ / | \ / _ \| |/ ___/

docs/commands/paymail_whois.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ __ _ _| |__ ____ |__| ______
1414
```
1515

1616

17-
Search 6public paymail providers for a handle.
17+
Search 6 public paymail providers for a handle.
1818

1919
```
2020
paymail whois [flags]

docs/examples.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Below are some examples using the **paymail** cli app
55
```bash
66
$ paymail
77
```
8-
<img src="../.github/IMAGES/help-command.gif?raw=true&v=6" alt="Help Command">
8+
<img src="../.github/IMAGES/help-command.gif?raw=true&v=7" alt="Help Command">
99

1010
Global flags for the entire application [(view command specs)](commands/paymail.md)
1111
```
@@ -29,7 +29,7 @@ $ paymail brfc list
2929
<details>
3030
<summary><strong><code>Show Example</code></strong></summary>
3131

32-
<img src="../.github/IMAGES/brfc-list-command.gif?raw=true&v=6" alt="BRFC List Command">
32+
<img src="../.github/IMAGES/brfc-list-command.gif?raw=true&v=7" alt="BRFC List Command">
3333
</details>
3434

3535
Custom flags for the brfc:list command [(view command specs)](commands/paymail_brfc.md)
@@ -47,7 +47,7 @@ $ paymail brfc generate --title "BRFC Specifications" --author "andy (nChain)" -
4747
<details>
4848
<summary><strong><code>Show Example</code></strong></summary>
4949

50-
<img src="../.github/IMAGES/brfc-generate-command.gif?raw=true&v=6" alt="BRFC Generate Command">
50+
<img src="../.github/IMAGES/brfc-generate-command.gif?raw=true&v=7" alt="BRFC Generate Command">
5151
</details>
5252

5353
<details>
@@ -87,7 +87,7 @@ $ paymail brfc search nChain
8787
<details>
8888
<summary><strong><code>Show Example</code></strong></summary>
8989

90-
<img src="../.github/IMAGES/brfc-search-command.gif?raw=true&v=6" alt="BRFC Search Command">
90+
<img src="../.github/IMAGES/brfc-search-command.gif?raw=true&v=7" alt="BRFC Search Command">
9191
</details>
9292

9393

@@ -106,7 +106,7 @@ $ paymail capabilities moneybutton.com
106106
<details>
107107
<summary><strong><code>Show Example</code></strong></summary>
108108

109-
<img src="../.github/IMAGES/capabilities-command.gif?raw=true&v=6" alt="Capabilities Command">
109+
<img src="../.github/IMAGES/capabilities-command.gif?raw=true&v=7" alt="Capabilities Command">
110110
</details>
111111

112112
Custom flags for the capabilities request [(view command specs)](commands/paymail_capabilities.md)
@@ -123,7 +123,7 @@ $ paymail p2p mrz@moneybutton.com
123123
<details>
124124
<summary><strong><code>Show Example</code></strong></summary>
125125

126-
<img src="../.github/IMAGES/p2p-command.gif?raw=true&v=6" alt="P2P Command">
126+
<img src="../.github/IMAGES/p2p-command.gif?raw=true&v=7" alt="P2P Command">
127127
</details>
128128

129129
Custom flags for the p2p command [(view command specs)](commands/paymail_p2p.md)
@@ -141,7 +141,7 @@ $ paymail resolve mrz@moneybutton.com
141141
<details>
142142
<summary><strong><code>Show Example</code></strong></summary>
143143

144-
<img src="../.github/IMAGES/resolve-command.gif?raw=true&v=6" alt="Resolve Command">
144+
<img src="../.github/IMAGES/resolve-command.gif?raw=true&v=7" alt="Resolve Command">
145145
</details>
146146

147147
Custom flags for the resolve command [(view command specs)](commands/paymail_resolve.md)
@@ -167,7 +167,7 @@ $ paymail validate moneybutton.com
167167
<details>
168168
<summary><strong><code>Show Example</code></strong></summary>
169169

170-
<img src="../.github/IMAGES/validate-command.gif?raw=true&v=6" alt="Validate Command">
170+
<img src="../.github/IMAGES/validate-command.gif?raw=true&v=7" alt="Validate Command">
171171
</details>
172172

173173
Custom flags for the validation command [(view command specs)](commands/paymail_validate.md)
@@ -193,7 +193,7 @@ $ paymail verify mrz@moneybutton.com 02ead23149a1e33df17325ec7a7ba9e0b20c674c57c
193193
<details>
194194
<summary><strong><code>Show Example</code></strong></summary>
195195

196-
<img src="../.github/IMAGES/verify-command.gif?raw=true&v=6" alt="Verify Command">
196+
<img src="../.github/IMAGES/verify-command.gif?raw=true&v=7" alt="Verify Command">
197197
</details>
198198

199199
Custom flags for the verify command [(view command specs)](commands/paymail_verify.md)
@@ -210,7 +210,7 @@ $ paymail whois mrz
210210
<details>
211211
<summary><strong><code>Show Example</code></strong></summary>
212212

213-
<img src="../.github/IMAGES/whois-command.gif?raw=true&v=6" alt="Whois Command">
213+
<img src="../.github/IMAGES/whois-command.gif?raw=true&v=7" alt="Whois Command">
214214
</details>
215215

216216
Custom flags for the whois command [(view command specs)](commands/paymail_whois.md)

0 commit comments

Comments
 (0)