Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: "thor csv" was called with arguments ["-i,", "-m,"] Usage: "thor datashift:import:csv -i, --input=INPUT -m, --model=MODEL" #65

Open
mices opened this issue Jan 27, 2018 · 9 comments

Comments

@mices
Copy link

mices commented Jan 27, 2018

What is this? No docs? What's the right syntax please?

@autotelik
Copy link
Owner

what is what ?

some docs - the readme is quite extensive and there is a large wiki -
but may be out of date as this is an open source project done for free in my spare time and I no longer work with Spree much

https://github.com/autotelik/datashift_spree/wiki

syntax as specified by Usage :
thor datashift:import:csv -i your_csv_file.csv

@autotelik
Copy link
Owner

the parent project : https://github.com/autotelik/datashift is up to date and with good readme, and probably does what you need

@mices
Copy link
Author

mices commented Jan 29, 2018

Thanks What was the idea behind building a spree specific version ? Why does datashift ask for --i and --m arguments to go with -i and -m ?

@autotelik
Copy link
Owner

to support non trivial processing like nested child taxons. if you really need that you can see in the code how I used to over write datashift ... there is a branch to migrate Spree loader specifics to new DataShift API - but its WIP .... https://github.com/autotelik/datashift_spree/blob/feature/update_api_latest_ds_and_spree/lib/loaders/spree/product_populator.rb

--i won't work. its -i or --input

thor help is useful, e.g

$ thor help datashift:import:csv
Usage:
thor datashift:import:csv -i, --input=INPUT -m, --model=MODEL

Options:
-m, --model=MODEL # The related active record model
-i, --input=INPUT # The input .xls file
-c, [--config=CONFIG] # YAML config file with defaults, over-rides etc
-a, [--assoc], [--no-assoc] # Include any associations supplied in the input
-e, [--exclude=one two three] # Use with -a : Exclude association types. Any from [:assignment, :belongs_to, :has_one, :has_many]
-v, [--verbose], [--no-verbose] # Verbose logging

import CSV file for specified active record model

@mices
Copy link
Author

mices commented Feb 11, 2018

thor datashift:import:csv -i, --input=products_export.csv -m, --model=Product

ERROR: "thor csv" was called with arguments ["-i,", "-m,"]
Usage: "thor datashift:import:csv -i, --input=INPUT -m, --model=MODEL"

thor datashift:import:csv -i products_export.csv
No value provided for required options '--model'

@autotelik
Copy link
Owner

it tells you the issue

No value provided for required options '--model'

@autotelik
Copy link
Owner

I think maybe reading around the basics of calling a rake or a thor task would help you. thor is nothing to do with me, it provides the task calling framework and defines how options are passed

you need to tell the task which DB model the csv file relates to

thor datashift:import:csv -i products_export.csv -m Product

@mices
Copy link
Author

mices commented Feb 12, 2018

Well you previously said "Usage: "thor datashift:import:csv -i, --input=INPUT -m, --model=MODEL"

@autotelik
Copy link
Owner

I supplied you the thor help ...that's how the thor gem and most linux type command line apps decides to print out its help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants