attic-labs / noms

The versioned, forkable, syncable database
Apache License 2.0
7.44k stars 266 forks source link

Proposal: `noms use` #3821

Open aboodman opened 5 years ago

aboodman commented 5 years ago

For a few reasons, I don't end up using noms config that much:

I think I'd like to replace noms config with noms use. It would work like this:

Here a transcript of a sample usage:

# noms use /tmp/mydb
Set environment variable $NOMS_DATABASE=/tmp/mydb

# noms use
Currently using $NOMS_DATABASE=/tmp/mydb
To stop using: `noms use --stop`, or remove the environment variable
aboodman commented 5 years ago

I forgot we already had this discussion:

https://github.com/attic-labs/noms/issues/1802 and https://github.com/attic-labs/noms/issues/2131.

Hm. I still find myself reaching for noms use.

aboodman commented 5 years ago

OK, reminding myself how config works, and the debate we had, I think maybe what I'm looking for is just:

# noms use /tmp/whatever
Wrote changes to ~/.nomsconfig
Default database now /tmp/whatever (previously /tmp/old-db)

# noms use
Currently using /tmp/whatever (see ~/.nomsconfig)
Stop using with `noms use --stop`

IOW, store in config file, not env variable.

Separately cli support for setting aliases would be cool.

aboodman commented 5 years ago

I also have a bad feeling that the CLI is not consistent in using config, so there'd have to be an audit to make it consistent.