suckit icon indicating copy to clipboard operation
suckit copied to clipboard

Library Binary Pattern

Open pinkforest opened this issue 3 years ago • 5 comments

Tracking Patch-Set

  • [x] Initial lib-bin split (files) #141
  • [ ] Move panics off library (snafu / anyhow / thiserror, quick_error)
  • [ ] Move bin-tests (under tests/) to use library (w/ httpmock) sans exec(bin)
  • [ ] Args parsing into binary
  • [ ] Output formatting into binary?
  • [ ] Create doctests for example uses of binary in README.md and include with doc_comment

Intent

@CohenArthur @Skallwar Are you okay if I change to lib-bin pattern from binary only now?

Essentially I would split all the library logic to library and binary that requires different things e.g. for shell related libraries.

This is a common pattern and will make organising code, benches, testing and dependency management easier between two sets of needs among other things.

Also common pattern is that library will never panic whilst binary may panic but idea is to propagate errors to binary.

pinkforest avatar Jul 02 '21 02:07 pinkforest

Yup, this is a really good idea. This is something that we had thought about earlier, but never got around to doing. I'd love to see it implemented.

CohenArthur avatar Jul 02 '21 07:07 CohenArthur

@CohenArthur @Skallwar initial lib-bin split is #141

pinkforest avatar Jul 06 '21 17:07 pinkforest

Add a checkbox list to this issue to make it a tracking issue of the patch-set

Skallwar avatar Jul 06 '21 18:07 Skallwar

I would also like to see the argument parsing moved to the bin

Skallwar avatar Jul 06 '21 18:07 Skallwar

Hi @pinkforest, I hope you are doing well. I was wondering if you are not planing to followup on this or if you are just taking a break?

Skallwar avatar Sep 16 '21 12:09 Skallwar