Skip to content
This repository has been archived by the owner on Aug 28, 2021. It is now read-only.

Proposal: noms use #3821

Open
aboodman opened this issue Jan 30, 2019 · 3 comments
Open

Proposal: noms use #3821

aboodman opened this issue Jan 30, 2019 · 3 comments

Comments

@aboodman
Copy link
Contributor

aboodman commented Jan 30, 2019

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

  • I can never remember the syntax and have to look it up each time
  • I don't really need the dataset or aliasing features frequently, so their presence is conceptual overhead I have to digest every time
  • I can't remember where the file is supposed to go
  • There's no CLI support to just do it for me, which is where we put everything else

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

  • Introduce an environment variable $NOMS_DATABASE which is just a database spec. If present, any spec on the CLI that includes a database component can omit it and it will default to this value.
  • As a convenience and to aid discovery, introduce noms use which manipulates this environment variable as a convenience

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
Copy link
Contributor Author

I forgot we already had this discussion:

#1802 and #2131.

Hm. I still find myself reaching for noms use.

@aboodman
Copy link
Contributor Author

aboodman commented Jan 30, 2019

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
Copy link
Contributor Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant