Sha256: 70bf96532bb53d74ebd75a74000f7985906948994f044b6646fc76a0af72fb04
Contents?: true
Size: 1.51 KB
Versions: 40
Compression:
Stored size: 1.51 KB
Contents
class Eco::API::UseCases::Default::Locations::TagtreeExtract # Class to define the CLI integration of a usecase anywhere it suits. class Cli < Eco::API::UseCases::Cli desc "Converts a tagtree into a specific format" add_option("-include-archived", "Whether the archived nodes should be included") do |options| options.deep_merge!(output: {include: {archived: true}}) end add_option("-format", "Kind of extract (list | json | nodes | csv_tree | excel_tree | excel_nodes )") do |options| format = SCR.get_arg("-format", with_param: true) options.deep_merge!(output: {format: format}) end add_option("-node-attrs", "Attributes to be dumped (i.e. name|id ). Default: id") do |options| attrs = SCR.get_arg("-node-attrs", with_param: true) options.deep_merge!(output: {attrs: attrs.split('|').map(&:to_sym)}) end add_option("-with-ancestors", "Include full path of ancestors in tree csv/excel_tree") do |options| options.deep_merge!(output: {include: {ancestors: true}}) end add_option("-indent", "Custom indentation (i.e. \"++\")") do |options| indent = SCR.get_arg("-indent", with_param: true) || "" options.deep_merge!(output: {indent: indent}) end add_option("-file-as-source", "Use a file as locations input (rather than the live locations)") do |options| file = SCR.get_file("-file-as-source", required: true, should_exist: true) options.deep_merge!(source: {file: file}) end end end
Version data entries
40 entries across 40 versions & 1 rubygems