Skip to content

Commit

Permalink
Define CLI option descriptions consistently (#496)
Browse files Browse the repository at this point in the history
Merge pull request 496
  • Loading branch information
ashmaroli authored Dec 10, 2022
1 parent 7bfad93 commit 144778e
Show file tree
Hide file tree
Showing 20 changed files with 115 additions and 115 deletions.
4 changes: 2 additions & 2 deletions lib/jekyll-import/importers/blogger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ module Importers
class Blogger < Importer
def self.specify_options(c)
c.option "source", "--source NAME", "The XML file (blog-MM-DD-YYYY.xml) path to import"
c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter (default: false)"
c.option "no-blogger-info", "--no-blogger-info", "not to leave blogger-URL info (id and old URL) in the front matter. (default: false)"
c.option "replace-internal-link", "--replace-internal-link", "replace internal links using the post_url liquid tag. (default: false)"
c.option "comments", "--comments", "import comments to _comments collection"
c.option "comments", "--comments", "import comments to _comments collection. (default: false)"
end

def self.validate(options)
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-import/importers/csv.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def self.require_deps
end

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

# Reads a csv with title, permalink, body, published_at, and filter.
Expand Down
4 changes: 2 additions & 2 deletions lib/jekyll-import/importers/drupal_common.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ module ClassMethods
}.freeze

def specify_options(c)
c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})"
c.option "dbname", "--dbname DB", "Database name"
c.option "user", "--user USER", "Database user name"
c.option "engine", "--engine [mysql|postgresql]", "Database engine (default: #{DEFAULTS["engine"].inspect})"
c.option "password", "--password PW", "Database user's password (default: #{DEFAULTS["password"].inspect})"
c.option "host", "--host HOST", "Database host name (default: #{DEFAULTS["host"].inspect})"
c.option "port", "--port PORT", "Database port name (default: #{DEFAULTS["port"].inspect})"
Expand All @@ -47,9 +47,9 @@ def require_deps
end

def process(options)
engine = options.fetch("engine", DEFAULTS["engine"])
dbname = options.fetch("dbname")
user = options.fetch("user")
engine = options.fetch("engine", DEFAULTS["engine"])
pass = options.fetch("password", DEFAULTS["password"])
host = options.fetch("host", DEFAULTS["host"])
port = options.fetch("port", DEFAULTS["port"])
Expand Down
12 changes: 6 additions & 6 deletions lib/jekyll-import/importers/easyblog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ def self.validate(options)
end

def self.specify_options(c)
c.option "dbname", "--dbname", "Database name"
c.option "user", "--user", "Database user name"
c.option "password", "--password", "Database user's password (default: '')"
c.option "host", "--host", "Database host name"
c.option "section", "--section", "Table prefix name"
c.option "prefix", "--prefix", "Table prefix name"
c.option "dbname", "--dbname", "Database name."
c.option "user", "--user", "Database user name."
c.option "password", "--password", "Database user's password. (default: '')"
c.option "host", "--host", "Database host name. (default: 'localhost')"
c.option "section", "--section", "Section ID. (default: '1')"
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
end

def self.require_deps
Expand Down
8 changes: 4 additions & 4 deletions lib/jekyll-import/importers/enki.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ def self.validate(options)
end

def self.specify_options(c)
c.option "dbname", "--dbname", "Database name"
c.option "user", "--user", "Database name"
c.option "password", "--password", 'Database name (default: "")'
c.option "host", "--host", "Database name"
c.option "dbname", "--dbname", "Database name."
c.option "user", "--user", "User name."
c.option "password", "--password", "Database password. (default: '')"
c.option "host", "--host", "Database host name. (default: 'localhost')"
end

def self.require_deps
Expand Down
14 changes: 7 additions & 7 deletions lib/jekyll-import/importers/joomla.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def self.validate(options)
end

def self.specify_options(c)
c.option "dbname", "--dbname", "Database name"
c.option "user", "--user", "Database user name"
c.option "password", "--password", "Database user's password (default: '')"
c.option "host", "--host", "Database host name"
c.option "port", "--port", "Database port"
c.option "section", "--section", "Table prefix name"
c.option "prefix", "--prefix", "Table prefix name"
c.option "dbname", "--dbname", "Database name."
c.option "user", "--user", "Database user name."
c.option "password", "--password", "Database user's password. (default: '')"
c.option "host", "--host", "Database host name. (default: 'localhost')"
c.option "port", "--port", "Database port. (default: '3306')"
c.option "section", "--section", "Section ID. (default: '1')"
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
end

def self.require_deps
Expand Down
14 changes: 7 additions & 7 deletions lib/jekyll-import/importers/joomla3.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ def self.validate(options)
end

def self.specify_options(c)
c.option "dbname", "--dbname", "Database name"
c.option "user", "--user", "Database user name"
c.option "password", "--password", "Database user's password (default: '')"
c.option "host", "--host", "Database host name"
c.option "port", "--port", "Database port"
c.option "category", "--category", "ID of the category"
c.option "prefix", "--prefix", "Table prefix name"
c.option "dbname", "--dbname", "Database name."
c.option "user", "--user", "Database user name."
c.option "password", "--password", "Database user's password. (default: '')"
c.option "host", "--host", "Database host name. (default: 'localhost')"
c.option "port", "--port", "Database port. (default: '3306')"
c.option "category", "--category", "ID of the category. (default: '0')"
c.option "prefix", "--prefix", "Table prefix name. (default: 'jos_')"
end

def self.require_deps
Expand Down
8 changes: 4 additions & 4 deletions lib/jekyll-import/importers/jrnl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ def self.require_deps
end

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

# Reads a jrnl file and creates a new post for each entry
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/marley.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def self.require_deps
end

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

def self.process(options)
Expand Down
2 changes: 1 addition & 1 deletion lib/jekyll-import/importers/mephisto.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.specify_options(c)
c.option "dbname", "--dbname DB", "Database name"
c.option "user", "--user USER", "Database user name"
c.option "password", "--password PW", "Database user's password (default: '')"
c.option "host", "--host HOST", 'Database host name (default: "localhost")'
c.option "host", "--host HOST", "Database host name (default: 'localhost')"
end

# This query will pull blog posts from all entries across all blogs. If
Expand Down
18 changes: 9 additions & 9 deletions lib/jekyll-import/importers/mt.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,17 @@ def self.require_deps
end

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

# By default this migrator will include posts for all your MovableType blogs.
Expand Down
6 changes: 3 additions & 3 deletions lib/jekyll-import/importers/pluxml.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ def self.require_deps
end

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

def self.validate(options)
Expand Down
22 changes: 11 additions & 11 deletions lib/jekyll-import/importers/roller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,19 @@ def self.require_deps
end

def self.specify_options(c)
c.option "dbname", "--dbname DB", "Database name (default: '')"
c.option "socket", "--socket SOCKET", "Database socket (default: '')"
c.option "user", "--user USER", "Database user name (default: '')"
c.option "password", "--password PW", "Database user's password (default: '')"
c.option "host", "--host HOST", "Database host name (default: 'localhost')"
c.option "port", "--port PORT", "Database port number (default: '3306')"
c.option "clean_entities", "--clean_entities", "Whether to clean entities (default: true)"
c.option "comments", "--comments", "Whether to import comments (default: true)"
c.option "categories", "--categories", "Whether to import categories (default: true)"
c.option "tags", "--tags", "Whether to import tags (default: true)"
c.option "dbname", "--dbname DB", "Database name."
c.option "user", "--user USER", "Database user name."
c.option "password", "--password PW", "Database user's password."
c.option "socket", "--socket SOCKET", "Database socket. (default: null)"
c.option "host", "--host HOST", "Database host name. (default: 'localhost')"
c.option "port", "--port PORT", "Database port number. (default: '3306')"
c.option "clean_entities", "--clean_entities", "Whether to clean entities. (default: true)"
c.option "comments", "--comments", "Whether to import comments. (default: true)"
c.option "categories", "--categories", "Whether to import categories. (default: true)"
c.option "tags", "--tags", "Whether to import tags. (default: true)"

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

# Main migrator function. Call this to perform the migration.
Expand Down
10 changes: 5 additions & 5 deletions lib/jekyll-import/importers/rss.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ module JekyllImport
module Importers
class RSS < Importer
def self.specify_options(c)
c.option "source", "--source NAME", "The RSS file or URL to import"
c.option "tag", "--tag NAME", "Add a specific tag to all posts"
c.option "extract_tags", "--extract_tags KEY", "Copies tags from the given subfield on the RSS <item>"
c.option "render_audio", "--render_audio", "Render <audio> element in posts for the enclosure URLs (default: false)"
c.option "canonical_link", "--canonical_link", "Copy original link as canonical_url to post. (default: false)"
c.option "source", "--source NAME", "The RSS file or URL to import."
c.option "tag", "--tag NAME", "Add a specific tag to all posts."
c.option "extract_tags", "--extract_tags KEY", "Copies tags from the given subfield on the RSS `<item>` to front matter. (default: null)"
c.option "render_audio", "--render_audio", "Render `<audio>` element in posts for the enclosure URLs. (default: false)"
c.option "canonical_link", "--canonical_link", "Add original link as `canonical_url` to post front matter. (default: false)"
end

def self.validate(options)
Expand Down
38 changes: 19 additions & 19 deletions lib/jekyll-import/importers/s9y_database.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,25 @@ def self.require_deps
end

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

# Main migrator function. Call this to perform the migration.
Expand Down
Loading

0 comments on commit 144778e

Please sign in to comment.