inveniosoftware / inveniosoftware/invenio-cli

Improve options experience

Open
#199 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement
Dominant language
Python
Stars
14
Forks
49
PR merge metrics
No merged PRs in 30d

Description

We can improve the command options.

### Consistency
Example:

invenio-cli packages lock --dev

but

invenio-cli check-requirements --development

Let's use --dev or --development throughout. Sometimes those have slightly different meanings: either we choose better names or keep with consistent names.

### Defaults in help text
Example

```console
invenio-cli run --help
Usage: invenio-cli run [OPTIONS]

Starts the local development server.

NOTE: this only makes sense locally so no --local option

Options:
-h, --host TEXT The interface to bind to.
-p, --port INTEGER The port to bind to.
-d, --debug / --no-debug Enable/disable debug mode including auto-
reloading (default: enabled).

-s, --services / -n, --no-services
Enable/disable dockerized services (default:
enabled).

--help Show this message and exit.
```

Would be nice to have default host and port value listed.

Another example:

```console
invenio-cli install --help
Usage: invenio-cli install [OPTIONS]

Installs the project locally.

Installs dependencies, creates instance directory, links invenio.cfg +
templates, copies images and other statics and finally builds front-end
assets.

Options:
--pre If specified, allows the installation of
alpha releases

-p, --production / -d, --development
Production mode copies statics/assets.
Development mode symlinks statics/assets.

--help Show this message and exit.
```

Which of `--production` or `--development` is default? (`--development` should be default)

Also we can try to use a consistent "(default: )" format used in many places. Although we sometimes use `(default: True)` and sometimes (default: enabled)` and sometimes `(default=True)`, so we can make those consistent too.

### Unique options

Some options are clashing:

```console
invenio-cli services setup --help
Usage: invenio-cli services setup [OPTIONS]

Setup local services.

Options:
-f, --force Force recreation of db tables, ES indices,
queues...

-n, --no-demo-data Disable the creation of demo data
--stop-services Stop containers after setup.
-s, --services / -n, --no-services
Enable/disable dockerized services (default:
enabled).

--help Show this message and exit.
```

What does `invenio-cli services setup -n` mean? Answer: --no-services . There might be other occurrences.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.