Skip to content

Commit f349bd0

Browse files
committed
fixed formatting for help text based on changes in cli package
1 parent f799800 commit f349bd0

File tree

21 files changed

+169
-43
lines changed

21 files changed

+169
-43
lines changed

cmds/csv2json/csv2json.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,19 @@ import (
4040
var (
4141
usage = `USAGE: %s [OPTIONS]`
4242

43-
description = `SYNOPSIS
43+
description = `
44+
45+
SYNOPSIS
4446
4547
%s reads CSV from stdin and writes a JSON to stdout. JSON output
4648
can be either an array of JSON blobs or one JSON blob (row as object)
4749
per line.
50+
4851
`
4952

50-
examples = `EXAMPLES
53+
examples = `
54+
55+
EXAMPLES
5156
5257
Convert data1.csv to data1.json using Unix pipes.
5358
@@ -56,6 +61,7 @@ Convert data1.csv to data1.json using Unix pipes.
5661
Convert data1.csv to JSON blobs, one line per blob
5762
5863
%s -as-blobs -i data1.csv
64+
5965
`
6066

6167
// Standard Options

cmds/csv2mdtable/csv2mdtable.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,18 @@ import (
3636
var (
3737
usage = `USAGE: %s [OPTIONS]`
3838

39-
description = `SYNOPSIS
39+
description = `
40+
41+
SYNOPSIS
4042
4143
%s reads CSV from stdin and writes a Github Flavored Markdown
4244
table to stdout.
45+
4346
`
4447

45-
examples = `EXAMPLES
48+
examples = `
49+
50+
EXAMPLES
4651
4752
Convert data1.csv to data1.md using Unix pipes.
4853
@@ -51,6 +56,7 @@ Convert data1.csv to data1.md using Unix pipes.
5156
Convert data1.csv to data1.md using options.
5257
5358
%s -i data1.csv -o data1.md
59+
5460
`
5561

5662
// Standard Options

cmds/csv2xlsx/csv2xlsx.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,18 @@ import (
3939
var (
4040
usage = `USAGE: %s [OPTIONS] WORKBOOK_NAME SHEET_NAME`
4141

42-
description = `SYNOPSIS
42+
description = `
43+
44+
SYNOPSIS
4345
4446
%s will take CSV input and create a new sheet in an Excel Workbook.
4547
If the Workbook does not exist then it is created.
48+
4649
`
4750

48-
examples = `EXAMPLE
51+
examples = `
52+
53+
EXAMPLE
4954
5055
%s -i data.csv MyWorkbook.xlsx 'My worksheet'
5156
@@ -56,6 +61,7 @@ called 'MyWorkbook.xlsx' with the contents of data.csv.
5661
5762
This does the same but the contents of data.csv are piped into
5863
the workbook's sheet.
64+
5965
`
6066

6167
// Standard Options

cmds/csvcols/csvcols.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,19 @@ const (
4545
var (
4646
usage = `USAGE: %s [OPTIONS] [ARGS_AS_COL_VALUES]`
4747

48-
description = `SYNOPSIS
48+
description = `
49+
50+
SYNOPSIS
4951
5052
%s converts a set of command line args into columns output in CSV format.
5153
It can also be used CSV input rows and rendering only the column numbers
5254
listed on the commandline (first column is 1 not 0).
55+
5356
`
5457

55-
examples = `EXAMPLES
58+
examples = `
59+
60+
EXAMPLES
5661
5762
Simple usage of building a CSV file one row at a time.
5863
@@ -73,6 +78,7 @@ Filter a 10 column CSV file for columns 1,4,6 (left most column is one)
7378
Filter a 10 columns CSV file for columns 1,4,6 from file named "10col.csv"
7479
7580
%s -i 10col.csv -col 1,4,6 > 3col.csv
81+
7682
`
7783

7884
// Standard Options

cmds/csvfind/csvfind.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ import (
3535
var (
3636
usage = `USAGE: %s [OPTIONS] TEXT_TO_MATCH`
3737

38-
description = `SYNOPSIS
38+
description = `
39+
40+
SYNOPSIS
3941
4042
%s processes a CSV file as input returning rows that contain the column
4143
with matched text. Columns are count from one instead of zero. Supports
4244
exact match as well as some Levenshtein matching.
45+
4346
`
4447

45-
examples = `EXAMPLES
48+
examples = `
49+
50+
EXAMPLES
4651
4752
Find the rows where the third column matches "The Red Book of Westmarch" exactly
4853
@@ -61,6 +66,7 @@ In this example we've appended the edit distance to see how close the matches ar
6166
You can also search for phrases in columns.
6267
6368
%s -i books.csv -col=2 -contains "Red Book"
69+
6470
`
6571

6672
// Standard Options

cmds/csvjoin/csvjoin.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,19 @@ import (
3535
var (
3636
usage = `USAGE: %s [OPTIONS] CSV1 CSV2 COL1 COL2`
3737

38-
description = `SYNOPSIS
38+
description = `
39+
40+
SYNOPSIS
3941
4042
%s outputs CSV content based on two CSV files with matching column values.
4143
Each CSV input file has a designated column to match on. The values are
4244
compared as strings. Columns are counted from one rather than zero.
45+
4346
`
4447

45-
examples = `EXAMPLES
48+
examples = `
49+
50+
EXAMPLES
4651
4752
Simple usage of building a merged CSV file from data1.csv
4853
and data2.csv where column 1 in data1.csv matches the value in
@@ -52,6 +57,7 @@ merged-data.csv..
5257
%s -csv1=data1.csv -col1=2 \
5358
-csv2=data2.csv -col2=4 \
5459
-output=merged-data.csv
60+
5561
`
5662

5763
// Standard Options

cmds/csvrows/csvrows.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,20 @@ const (
4242
var (
4343
usage = `USAGE: %s [OPTIONS] [ARGS_AS_ROW_VALUES]`
4444

45-
description = `SYNOPSIS
45+
description = `
46+
47+
SYNOPSIS
4648
4749
%s converts a set of command line args into rows of CSV formated output.
4850
It can also be used to filter or list specific rows of CSV input
4951
The first row is 1 not 0. Often row 1 is the header row and %s makes it
5052
easy to output only the data rows.
53+
5154
`
5255

53-
examples = `EXAMPLES
56+
examples = `
57+
58+
EXAMPLES
5459
5560
Simple usage of building a CSV file one rows at a time.
5661
@@ -71,6 +76,7 @@ Filter a 10 row CSV file for rows 1,4,6 (top most row is one)
7176
Filter a 10 row CSV file for rows 1,4,6 from file named "10row.csv"
7277
7378
%s -i 10row.csv -row 1,4,6 > 3rows.csv
79+
7480
`
7581

7682
// Standard options

cmds/finddir/finddir.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,22 @@ import (
3838
var (
3939
usage = `USAGE: %s [OPTIONS] [TARGET] [DIRECTORIES_TO_SEARCH]`
4040

41-
description = `SYNOPSIS
41+
description = `
42+
43+
SYNOPSIS
4244
4345
%s finds directory based on matching prefix, suffix or contained text in base filename.
46+
4447
`
4548

46-
examples = `EXAMPLE
49+
examples = `
50+
51+
EXAMPLE
4752
4853
%s -p img
4954
5055
Find all subdirectories starting with "img".
56+
5157
`
5258

5359
// Standard Options

cmds/findfile/findfile.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,22 @@ import (
3838
var (
3939
usage = `USAGE: %s [OPTIONS] [TARGET] [DIRECTORIES_TO_SEARCH]`
4040

41-
description = `SYNOPSIS
41+
description = `
42+
43+
SYNOPSIS
4244
4345
%s finds files based on matching prefix, suffix or contained text in base filename.
46+
4447
`
4548

46-
examples = `EXAMPLE
49+
examples = `
50+
51+
EXAMPLE
4752
4853
%s -s .md
4954
5055
Search the current directory and subdirectories for Markdown files with extension of ".md".
56+
5157
`
5258

5359
// Standard Options

cmds/jsoncols/jsoncols.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ import (
2626
var (
2727
usage = `USAGE: %s [OPTIONS] [EXPRESSION] [INPUT_FILENAME] [OUTPUT_FILENAME]`
2828

29-
description = `SYSNOPSIS
29+
description = `
30+
31+
SYSNOPSIS
3032
3133
%s provides scripting flexibility for data extraction from JSON data
3234
returning the results in columns. This is helpful in flattening content
@@ -40,9 +42,12 @@ extracted is a comma. This can be overridden with an option.
4042
+ OUTPUT_FILENAME is the filename to write or a dash "-" if you want to
4143
explicity write to stdout
4244
+ if not provided then %s write to stdout
45+
4346
`
4447

45-
examples = `EXAMPLES
48+
examples = `
49+
50+
EXAMPLES
4651
4752
If myblob.json contained
4853
@@ -73,6 +78,7 @@ You can also pipe JSON data in.
7378
Would yield
7479
7580
"Doe, Jane",[email protected],42
81+
7682
`
7783

7884
// Basic Options

0 commit comments

Comments
 (0)