Skip to content

Commit 144778e

Browse files
authored
Define CLI option descriptions consistently (#496)
Merge pull request 496
1 parent 7bfad93 commit 144778e

20 files changed

+115
-115
lines changed

Diff for: lib/jekyll-import/importers/blogger.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ module Importers
55
class Blogger < Importer
66
def self.specify_options(c)
77
c.option "source", "--source NAME", "The XML file (blog-MM-DD-YYYY.xml) path to import"
8-
c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter (default: false)"
8+
c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter. (default: false)"
99
c.option "replace-internal-link", "--replace-internal-link", "replace internal links using the post_url liquid tag. (default: false)"
10-
c.option "comments", "--comments", "import comments to _comments collection"
10+
c.option "comments", "--comments", "import comments to _comments collection. (default: false)"
1111
end
1212

1313
def self.validate(options)

Diff for: lib/jekyll-import/importers/csv.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ def self.require_deps
1212
end
1313

1414
def self.specify_options(c)
15-
c.option "file", "--file NAME", 'The CSV file to import (default: "posts.csv")'
16-
c.option "no-front-matter", "--no-front-matter", "Do not add the default front matter to the post body"
15+
c.option "file", "--file NAME", "The CSV file to import. (default: 'posts.csv')"
16+
c.option "no-front-matter", "--no-front-matter", "Do not add the default front matter to the post body. (default: false)"
1717
end
1818

1919
# Reads a csv with title, permalink, body, published_at, and filter.

Diff for: lib/jekyll-import/importers/drupal_common.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ module ClassMethods
2323
}.freeze
2424

2525
def specify_options(c)
26-
c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})"
2726
c.option "dbname", "--dbname DB", "Database name"
2827
c.option "user", "--user USER", "Database user name"
28+
c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})"
2929
c.option "password", "--password PW", "Database user's password (default: #{DEFAULTS["password"].inspect})"
3030
c.option "host", "--host HOST", "Database host name (default: #{DEFAULTS["host"].inspect})"
3131
c.option "port", "--port PORT", "Database port name (default: #{DEFAULTS["port"].inspect})"
@@ -47,9 +47,9 @@ def require_deps
4747
end
4848

4949
def process(options)
50-
engine = options.fetch("engine", DEFAULTS["engine"])
5150
dbname = options.fetch("dbname")
5251
user = options.fetch("user")
52+
engine = options.fetch("engine", DEFAULTS["engine"])
5353
pass = options.fetch("password", DEFAULTS["password"])
5454
host = options.fetch("host", DEFAULTS["host"])
5555
port = options.fetch("port", DEFAULTS["port"])

Diff for: lib/jekyll-import/importers/easyblog.rb

+6-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ def self.validate(options)
1010
end
1111

1212
def self.specify_options(c)
13-
c.option "dbname", "--dbname", "Database name"
14-
c.option "user", "--user", "Database user name"
15-
c.option "password", "--password", "Database user's password (default: '')"
16-
c.option "host", "--host", "Database host name"
17-
c.option "section", "--section", "Table prefix name"
18-
c.option "prefix", "--prefix", "Table prefix name"
13+
c.option "dbname", "--dbname", "Database name."
14+
c.option "user", "--user", "Database user name."
15+
c.option "password", "--password", "Database user's password. (default: '')"
16+
c.option "host", "--host", "Database host name. (default: 'localhost')"
17+
c.option "section", "--section", "Section ID. (default: '1')"
18+
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
1919
end
2020

2121
def self.require_deps

Diff for: lib/jekyll-import/importers/enki.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def self.validate(options)
2020
end
2121

2222
def self.specify_options(c)
23-
c.option "dbname", "--dbname", "Database name"
24-
c.option "user", "--user", "Database name"
25-
c.option "password", "--password", 'Database name (default: "")'
26-
c.option "host", "--host", "Database name"
23+
c.option "dbname", "--dbname", "Database name."
24+
c.option "user", "--user", "User name."
25+
c.option "password", "--password", "Database password. (default: '')"
26+
c.option "host", "--host", "Database host name. (default: 'localhost')"
2727
end
2828

2929
def self.require_deps

Diff for: lib/jekyll-import/importers/joomla.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def self.validate(options)
1010
end
1111

1212
def self.specify_options(c)
13-
c.option "dbname", "--dbname", "Database name"
14-
c.option "user", "--user", "Database user name"
15-
c.option "password", "--password", "Database user's password (default: '')"
16-
c.option "host", "--host", "Database host name"
17-
c.option "port", "--port", "Database port"
18-
c.option "section", "--section", "Table prefix name"
19-
c.option "prefix", "--prefix", "Table prefix name"
13+
c.option "dbname", "--dbname", "Database name."
14+
c.option "user", "--user", "Database user name."
15+
c.option "password", "--password", "Database user's password. (default: '')"
16+
c.option "host", "--host", "Database host name. (default: 'localhost')"
17+
c.option "port", "--port", "Database port. (default: '3306')"
18+
c.option "section", "--section", "Section ID. (default: '1')"
19+
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
2020
end
2121

2222
def self.require_deps

Diff for: lib/jekyll-import/importers/joomla3.rb

+7-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ def self.validate(options)
1010
end
1111

1212
def self.specify_options(c)
13-
c.option "dbname", "--dbname", "Database name"
14-
c.option "user", "--user", "Database user name"
15-
c.option "password", "--password", "Database user's password (default: '')"
16-
c.option "host", "--host", "Database host name"
17-
c.option "port", "--port", "Database port"
18-
c.option "category", "--category", "ID of the category"
19-
c.option "prefix", "--prefix", "Table prefix name"
13+
c.option "dbname", "--dbname", "Database name."
14+
c.option "user", "--user", "Database user name."
15+
c.option "password", "--password", "Database user's password. (default: '')"
16+
c.option "host", "--host", "Database host name. (default: 'localhost')"
17+
c.option "port", "--port", "Database port. (default: '3306')"
18+
c.option "category", "--category", "ID of the category. (default: '0')"
19+
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
2020
end
2121

2222
def self.require_deps

Diff for: lib/jekyll-import/importers/jrnl.rb

+4-4
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ def self.require_deps
1212
end
1313

1414
def self.specify_options(c)
15-
c.option "file", "--file FILENAME", 'Journal file (default: "~/journal.txt")'
16-
c.option "time_format", "--time_format FORMAT", 'Time format of your journal (default: "%Y-%m-%d %H:%M")'
17-
c.option "extension", "--extension EXT", 'Output extension (default: "md")'
18-
c.option "layout", "--layout NAME", 'Output post layout (default: "post")'
15+
c.option "file", "--file FILENAME", "Journal file. (default: '~/journal.txt')"
16+
c.option "time_format", "--time_format FORMAT", "Time format of your journal. (default: '%Y-%m-%d %H:%M')"
17+
c.option "extension", "--extension EXT", "Output extension. (default: 'md')"
18+
c.option "layout", "--layout NAME", "Output post layout. (default: 'post')"
1919
end
2020

2121
# Reads a jrnl file and creates a new post for each entry

Diff for: lib/jekyll-import/importers/marley.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def self.require_deps
2828
end
2929

3030
def self.specify_options(c)
31-
c.option "marley_data_dir", "--marley_data_dir DIR", "The dir containing your marley data"
31+
c.option "marley_data_dir", "--marley_data_dir DIR", "The dir containing your marley data."
3232
end
3333

3434
def self.process(options)

Diff for: lib/jekyll-import/importers/mephisto.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def self.specify_options(c)
4040
c.option "dbname", "--dbname DB", "Database name"
4141
c.option "user", "--user USER", "Database user name"
4242
c.option "password", "--password PW", "Database user's password (default: '')"
43-
c.option "host", "--host HOST", 'Database host name (default: "localhost")'
43+
c.option "host", "--host HOST", "Database host name (default: 'localhost')"
4444
end
4545

4646
# This query will pull blog posts from all entries across all blogs. If

Diff for: lib/jekyll-import/importers/mt.rb

+9-9
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,17 @@ def self.require_deps
3232
end
3333

3434
def self.specify_options(c)
35-
c.option "engine", "--engine ENGINE", "Database engine, (default: 'mysql', postgres also supported)"
36-
c.option "dbname", "--dbname DB", "Database name"
37-
c.option "user", "--user USER", "Database user name"
38-
c.option "password", "--password PW", "Database user's password, (default: '')"
39-
c.option "host", "--host HOST", 'Database host name (default: "localhost")'
40-
c.option "port", "--port PORT", "Custom database port connect to (optional)"
41-
c.option "blog_id", "--blog_id ID", "Specify a single Movable Type blog ID to import (default: all blogs)"
42-
c.option "categories", "--categories", "If true, save post's categories in its YAML front matter. (default: true)"
35+
c.option "dbname", "--dbname DB", "Database name."
36+
c.option "user", "--user USER", "Database user name."
37+
c.option "engine", "--engine ENGINE", "Database engine ('mysql' or 'postgres'). (default: 'mysql')"
38+
c.option "password", "--password PW", "Database user's password. (default: '')"
39+
c.option "host", "--host HOST", "Database host name. (default: 'localhost')"
40+
c.option "port", "--port PORT", "Custom database port connect to. (default: null)"
41+
c.option "blog_id", "--blog_id ID", "Specify a single Movable Type blog ID to import. (default: null (all blogs))"
42+
c.option "categories", "--categories", "When true, save post's categories in its YAML front matter. (default: true)"
4343
c.option "src_encoding", "--src_encoding ENCODING", "Encoding of strings from database. (default: UTF-8)"
4444
c.option "dest_encoding", "--dest_encoding ENCODING", "Encoding of output strings. (default: UTF-8)"
45-
c.option "comments", "--comments", "If true, output comments in _comments directory (default: false)"
45+
c.option "comments", "--comments", "When true, output comments in `_comments` directory. (default: false)"
4646
end
4747

4848
# By default this migrator will include posts for all your MovableType blogs.

Diff for: lib/jekyll-import/importers/pluxml.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ def self.require_deps
1212
end
1313

1414
def self.specify_options(c)
15-
c.option "source", "--source NAME", "The PluXML data directory to import"
16-
c.option "layout", "--layout NAME", "The layout to apply"
17-
c.option "avoid_liquid", "--avoid_liquid true", "Will add render_with_liquid: false in frontmatter"
15+
c.option "source", "--source NAME", "The PluXml data directory to import."
16+
c.option "layout", "--layout NAME", "The layout to apply. (default: 'post')"
17+
c.option "avoid_liquid", "--avoid_liquid", "Will add `render_with_liquid: false` in front matter. (default: false)"
1818
end
1919

2020
def self.validate(options)

Diff for: lib/jekyll-import/importers/roller.rb

+11-11
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ def self.require_deps
1414
end
1515

1616
def self.specify_options(c)
17-
c.option "dbname", "--dbname DB", "Database name (default: '')"
18-
c.option "socket", "--socket SOCKET", "Database socket (default: '')"
19-
c.option "user", "--user USER", "Database user name (default: '')"
20-
c.option "password", "--password PW", "Database user's password (default: '')"
21-
c.option "host", "--host HOST", "Database host name (default: 'localhost')"
22-
c.option "port", "--port PORT", "Database port number (default: '3306')"
23-
c.option "clean_entities", "--clean_entities", "Whether to clean entities (default: true)"
24-
c.option "comments", "--comments", "Whether to import comments (default: true)"
25-
c.option "categories", "--categories", "Whether to import categories (default: true)"
26-
c.option "tags", "--tags", "Whether to import tags (default: true)"
17+
c.option "dbname", "--dbname DB", "Database name."
18+
c.option "user", "--user USER", "Database user name."
19+
c.option "password", "--password PW", "Database user's password."
20+
c.option "socket", "--socket SOCKET", "Database socket. (default: null)"
21+
c.option "host", "--host HOST", "Database host name. (default: 'localhost')"
22+
c.option "port", "--port PORT", "Database port number. (default: '3306')"
23+
c.option "clean_entities", "--clean_entities", "Whether to clean entities. (default: true)"
24+
c.option "comments", "--comments", "Whether to import comments. (default: true)"
25+
c.option "categories", "--categories", "Whether to import categories. (default: true)"
26+
c.option "tags", "--tags", "Whether to import tags. (default: true)"
2727

2828
c.option "status", "--status STATUS,STATUS2", Array,
29-
"Array of allowed statuses (default: ['PUBLISHED'], other options: 'DRAFT')"
29+
"Array of allowed statuses (either ['PUBLISHED'] or ['DRAFT']). (default: ['PUBLISHED'])"
3030
end
3131

3232
# Main migrator function. Call this to perform the migration.

Diff for: lib/jekyll-import/importers/rss.rb

+5-5
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ module JekyllImport
44
module Importers
55
class RSS < Importer
66
def self.specify_options(c)
7-
c.option "source", "--source NAME", "The RSS file or URL to import"
8-
c.option "tag", "--tag NAME", "Add a specific tag to all posts"
9-
c.option "extract_tags", "--extract_tags KEY", "Copies tags from the given subfield on the RSS <item>"
10-
c.option "render_audio", "--render_audio", "Render <audio> element in posts for the enclosure URLs (default: false)"
11-
c.option "canonical_link", "--canonical_link", "Copy original link as canonical_url to post. (default: false)"
7+
c.option "source", "--source NAME", "The RSS file or URL to import."
8+
c.option "tag", "--tag NAME", "Add a specific tag to all posts."
9+
c.option "extract_tags", "--extract_tags KEY", "Copies tags from the given subfield on the RSS `<item>` to front matter. (default: null)"
10+
c.option "render_audio", "--render_audio", "Render `<audio>` element in posts for the enclosure URLs. (default: false)"
11+
c.option "canonical_link", "--canonical_link", "Add original link as `canonical_url` to post front matter. (default: false)"
1212
end
1313

1414
def self.validate(options)

Diff for: lib/jekyll-import/importers/s9y_database.rb

+19-19
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,25 @@ def self.require_deps
1717
end
1818

1919
def self.specify_options(c)
20-
c.option "dbname", "--dbname DB", "Database name (default: '')"
21-
c.option "socket", "--socket SOCKET", "Database socket (default: '')"
22-
c.option "user", "--user USER", "Database user name (default: '')"
23-
c.option "password", "--password PW", "Database user's password (default: '')"
24-
c.option "host", "--host HOST", "Database host name (default: 'localhost')"
25-
c.option "port", "--port PORT", "Custom database port connect to (default: 3306)"
26-
c.option "table_prefix", "--table_prefix PREFIX", "Table prefix name (default: 'serendipity_')"
27-
c.option "clean_entities", "--clean_entities", "Whether to clean entities (default: true)"
28-
c.option "comments", "--comments", "Whether to import comments (default: true)"
29-
c.option "categories", "--categories", "Whether to import categories (default: true)"
30-
c.option "tags", "--tags", "Whether to import tags (default: true)"
31-
c.option "drafts", "--drafts", "Whether to export drafts as well"
32-
c.option "markdown", "--markdown", "convert into markdown format (default: false)"
33-
c.option "permalinks", "--permalinks", "preserve S9Y permalinks (default: false)"
34-
c.option "excerpt_separator", "--excerpt_separator", "Demarkation for excerpts (default: '<a id=\"extended\"></a>')"
35-
c.option "includeentry", "--includeentry", "Replace macros from the includeentry plugin (default: false)"
36-
c.option "imgfig", "--imgfig", "Replace nested img and youtube divs with HTML figure tags (default: true)"
37-
c.option "linebreak", "--linebreak", "Line break processing: wp, nokogiri, ignore (default: wp)"
38-
c.option "relative", "--relative", "Convert links with this prefix to relative (default:nil)"
20+
c.option "dbname", "--dbname DB", "Database name. (default: '')"
21+
c.option "socket", "--socket SOCKET", "Database socket. (default: '')"
22+
c.option "user", "--user USER", "Database user name. (default: '')"
23+
c.option "password", "--password PW", "Database user's password. (default: '')"
24+
c.option "host", "--host HOST", "Database host name. (default: 'localhost')"
25+
c.option "port", "--port PORT", "Custom database port connect to. (default: 3306)"
26+
c.option "table_prefix", "--table_prefix PREFIX", "Table prefix name. (default: 'serendipity_')"
27+
c.option "clean_entities", "--clean_entities", "Whether to clean entities. (default: true)"
28+
c.option "comments", "--comments", "Whether to import comments. (default: true)"
29+
c.option "categories", "--categories", "Whether to import categories. (default: true)"
30+
c.option "tags", "--tags", "Whether to import tags. (default: true)"
31+
c.option "drafts", "--drafts", "Whether to export drafts as well. (default: true)"
32+
c.option "markdown", "--markdown", "convert into markdown format. (default: false)"
33+
c.option "permalinks", "--permalinks", "preserve S9Y permalinks. (default: false)"
34+
c.option "excerpt_separator", "--excerpt_separator", "Demarkation for excerpts. (default: '<a id=\"extended\"></a>')"
35+
c.option "includeentry", "--includeentry", "Replace macros from the includeentry plugin. (default: false)"
36+
c.option "imgfig", "--imgfig", "Replace nested img and youtube divs with HTML figure tags. (default: true)"
37+
c.option "linebreak", "--linebreak", "Line break processing: wp, nokogiri, ignore. (default: wp)"
38+
c.option "relative", "--relative", "Convert links with this prefix to relative. (default: nil)"
3939
end
4040

4141
# Main migrator function. Call this to perform the migration.

0 commit comments

Comments
 (0)