You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: cmd/root.go
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -6,28 +6,26 @@ import (
6
6
7
7
"github.com/dnnrly/httpref"
8
8
"github.com/spf13/cobra"
9
+
10
+
"github.com/dnnrly/paragraphical"
9
11
)
10
12
11
-
vartitles=false
13
+
var (
14
+
titles=false
15
+
width=100
16
+
)
12
17
13
18
// rootCmd represents the base command when ctitlesed without any subcommands
14
19
varrootCmd=&cobra.Command{
15
20
Use: "httpref [filter]",
16
21
Args: cobra.MaximumNArgs(1),
17
22
Short: "Command line access to HTTP references",
18
-
Long: `This displays useful information related to HTTP.
23
+
Long: paragraphical.Format(width, `This displays useful information related to HTTP.
19
24
20
-
It will prefer exact matches where there are mutliple entries matching
21
-
the filter (e.g. Accept and Accept-Language). If you want to match
22
-
everything with the same prefix then you can use * as a wildcard suffix,
23
-
for example:
25
+
It will prefer exact matches where there are mutliple entries matching the filter (e.g. Accept and Accept-Language). If you want to match everything with the same prefix then you can use * as a wildcard suffix, for example:
24
26
httpref 'Accept*'
25
27
26
-
Most of the content comes from the Mozilla developer
Most of the content comes from the Mozilla developer documentation (https://developer.mozilla.org/en-US/docs/Web/HTTP) and is copyright Mozilla and individual contributors. See https://developer.mozilla.org/en-US/docs/MDN/About#Copyrights_and_licenses for details.`),
31
29
RunE: root,
32
30
}
33
31
@@ -41,7 +39,9 @@ func Execute() {
41
39
}
42
40
43
41
funcinit() {
44
-
rootCmd.PersistentFlags().BoolVarP(&titles, "titles", "", titles, "List titles of the summaries available")
42
+
rootCmd.PersistentFlags().BoolVarP(&titles, "titles", "t", titles, "List titles of the summaries available")
43
+
rootCmd.PersistentFlags().IntVarP(&width, "width", "w", width, "Width to fit the output to")
0 commit comments