libp2p / libp2p/go-libp2p-daemon

Organising option flags

Open
#35 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
95
Forks
41
PR merge metrics
No merged PRs in 30d

Description

As users demand more functionalities (e.g. #34), we're likely to see a proliferation of option flags for the daemon binary. While the daemon is marked as an _experimental_ project, we should attempt to bring in structure to our option flags. Let's agree on an approach and lock it in.

Proposal:

* Let's be idiomatic. I found that camelCasing flags is not really idiomatic in Go: `go test` uses no casing or separators, and `ipfs` uses hyphens. My proposal is to use hyphens.
* Let's namespace our flags.
* Let's strive for consistency. Consistency can look different in each namespace, e.g. for transports, we can make all flags additive (a flag adds support for a transport), and provide a single subtractive flag to disable OOTB defaults. The connection manager deals with values, so it'll look different.

For transports, this can look as follows:

```
-tpt-enable-quic enables the QUIC transport
-tpt-enable-ws enables the WebSockets transport
-tpt-enable-tcp enables the TCP transport
-tpt-disable-defaults disables the default transports
```

So if I wanted to enable ONLY QUIC, I'd do the following:

```
p2pd -tpt-disable-defaults -tpt-enable-quic
```

WDYT? CC @vyzo @bigs @jrhea @cheatfate @mhchia

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the daemon's existing option flags and issue #34, then compare the proposed hyphenated, namespaced transport scheme with current behavior. Done means the project reaches a decision on flag naming, namespacing, and per-namespace consistency.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.