lib/js_dependency/cli.rb in js_dependency-0.3.8 vs lib/js_dependency/cli.rb in js_dependency-0.3.9
- old
+ new
@@ -13,10 +13,11 @@
method_option :output_path, type: :string, aliases: "-o", desc: "Output file path"
method_option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
method_option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
method_option :name_level, type: :numeric, aliases: "-n", desc: "Output name level"
method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
def export_mermaid
args = JsDependency::CliUtils::Yaml.new.args
config = JsDependency::CliUtils::Config.new(options, args)
puts JsDependency.export_mermaid(
@@ -35,10 +36,11 @@
method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
method_option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
method_option :output_path, type: :string, aliases: "-o", desc: "Output file path"
method_option :parent_analyze_level, type: :numeric, aliases: "-p", desc: "Output level of parent dependency"
method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
def parents
args = JsDependency::CliUtils::Yaml.new.args
config = JsDependency::CliUtils::Config.new(options, args)
puts JsDependency.parents(
@@ -55,10 +57,11 @@
method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
method_option :target_path, type: :string, aliases: "-t", desc: "Target file that you want to analyze."
method_option :output_path, type: :string, aliases: "-o", desc: "Output file path"
method_option :child_analyze_level, type: :numeric, aliases: "-c", desc: "Output level of child dependency"
method_option :excludes, type: :array, aliases: "-e", desc: "Exclude the word that is included in the path"
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
def children
args = JsDependency::CliUtils::Yaml.new.args
config = JsDependency::CliUtils::Config.new(options, args)
puts JsDependency.children(
@@ -71,10 +74,11 @@
).join("\n")
end
desc "orphan", "export components than is not depended by others"
method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
def orphan
args = JsDependency::CliUtils::Yaml.new.args
config = JsDependency::CliUtils::Config.new(options, args)
puts JsDependency.orphan(
@@ -83,9 +87,10 @@
).join("\n")
end
desc "leave", "export components than is not depended by others"
method_option :src_path, type: :string, aliases: "-s", desc: "Root folder."
+ method_option :alias_paths, type: :hash, aliases: "-a", desc: "Alias paths by hash format."
def leave
args = JsDependency::CliUtils::Yaml.new.args
config = JsDependency::CliUtils::Config.new(options, args)
puts JsDependency.leave(