Go-ipfs: Change flags from `--opt=false` to `--no-opt`

Created on 3 Jun 2016  路  10Comments  路  Source: ipfs/go-ipfs

In https://github.com/ipfs/go-ipfs/pull/2785, @Kubuxu and I are discussing the best way to outline synopses for go-ipfs.

@Kubuxu:

...we should change options like: --pin to --no-pin or --progress to --no-progress and so on. I had no idea for a long time that you could do --pin=false.

I agree with this. I didn't know that --pin=false was an option (or I forgot).

I think that setting the flags and options to --no-pin makes more sense and is more intuitive. Git does this, too:

NAME
       git-add - Add file contents to the index

SYNOPSIS
       git add [--verbose | -v] [--dry-run | -n] [--force | -f] [--interactive | -i] [--patch | -p]
                 [--edit | -e] [--[no-]all | --[no-]ignore-removal | [--update | -u]]
                 [--intent-to-add | -N] [--refresh] [--ignore-errors] [--ignore-missing]
                 [--] [<pathspec>...]

See --[no-]ignore-removal?

What do you think?

kinquestion

Most helpful comment

We could make it so all boolean options have no counterparts. So there is --pin, --no-pin and also option to do --pin=false for sake of compatibility.

All 10 comments

We could make it so all boolean options have no counterparts. So there is --pin, --no-pin and also option to do --pin=false for sake of compatibility.

As it touches same code as: https://github.com/ipfs/go-ipfs/pull/2785 I am adding it in the same PR (no conflicts this way).

mmm... we decided explicitly against this a while back, and opted instead for the --opt=false style options

I don't know what was the reason previously. Currently, knowing default values, and having synopsis generator I really don't see any disadvantages.

@jbenet @lgierth thoughts here?

We have decided against it.

@Kubuxu is this reason documented anywhere?

@Kubuxu Can you explain why? Where was it discussed?

I talked with @jbenet about it, he said that he will explain it latter here.

always prefer --option over --no-option, its much clearer and better UX

Was this page helpful?
0 / 5 - 0 ratings

Related issues

funkyfuture picture funkyfuture  路  3Comments

djdv picture djdv  路  3Comments

slrslr picture slrslr  路  3Comments

Kubuxu picture Kubuxu  路  3Comments

zignig picture zignig  路  3Comments