-
Notifications
You must be signed in to change notification settings - Fork 7
[1.0] Finalize CLI API #9
Comments
Glad to see this! As for my two cents, I prefer the named arguments, but think that specifying |
@Piefayth To clarify, you'd want to see: # one data source
gramps dev --data-source .
# two data sources
gramps dev --data-sources ../dataSource, ../otherSource
# w/shorthand alias
gramps dev -d ../dataSource, ../otherSource
Is that correct? |
I ran an unofficial poll in all the Slack channels I'm in + Twitter, and the overwhelming consensus was this:
Because the
Does anyone object to this API? If not, I'm going to get to work porting over the code so we can get to 1.0. |
Since there aren't any objections, I'm going to call this final and move forward with dev. |
Per the discussion that started on #4, we need to finalize the actual API of this tool. We know what it should do, but need to agree on how to actually expose the commands.
I'm porting the last comment from #4 to here:
@corycook @ecwyne To try and consolidate things, let me do a recap of where we are so far:
Cory’s Proposal
API
Examples
Additional Recommendation from Cory: Don’t Transpile
I'm personally against this because it's moving us further and further from a plug-and-play solution, but I'd be down to have an opt-out flag (e.g.
gramps --no-transpile
). A requirement to set up additional tools (e.g.concurrently
) for dev seems like more overhead than is necessary. For advanced users, I think an opt-out is fine, but for someone who's new to this I think they should be able to just rungramps dev
and see some data in GraphiQL.Eric’s Proposal
API
Examples
Jason’s Proposal
API
Examples
The Good Stuff
I think we've all got good ideas and good rationale behind them, so I want to see if I can walk through our main points of contention
Positional vs. Explicit Args
My preference is to remain explicit. Positional arguments are confusing to me, because it's not clear if
./one ./two
is an input > output arg, or a "use both of these" arg. I think it's easier to reason about code that tells you what it does with descriptive options.Command Name
I think @ecwyne had a great idea to change the command from
gramps
to something more clear:gramps dev
. We may want to add new commands in the future (e.g. new data source creation), plus it makes it more obvious that this is only intended for development.Pulling It All Together
Based on the three options, I've got two suggestions:
Potential Named Args API
Examples
Potential Positional API
Examples
What does everyone think of this?
The text was updated successfully, but these errors were encountered: