Closed jcaesar closed 2 years ago
IMO and for my use case, some kind of builder pattern like what you propose sounds good.
ipfs add --help
would become ipfs.add(None).help();
ipfs add --pin --cid-version=1 <path>
becomes ipfs.add(Some(path)).pin().cid_version(1);
For global config IDK I don't use it.
Haven't looked into it much, just my 2c...
Could this be added now that I've restructured the repo? This fell off my radar, but I think it would be a good change. Apologies!
Argh, I accidentally the PR. Yes, it can be added, but things got a bit more awkward, I think. I'll open a new PR soon.
This is a draft implementing #62 (cc @ec1oud). Implementing, as a feature, a way to specify
--offline
is fairly simple. Providing a sane interface not so much.ipfs files --help
, showing--flush
), which one might eventually want to supportI've contemplated breaking it up into groups, but that'd be a rather large change, leading to something like
client.with_opts(global_ops).files(files_opts).write_with_opts("foo", write_opts)
, but that'd be a rather large breaking change.Anyone with any neat suggestions for an interface?