Comments (2)
Hi @etdr, the use case you mentioned is quite common and currently the aliasing method is indeed the only way to come around this, your environment variable solution is a good suggestion.
I'm now thinking of letting dt-cli
try to read a DT_CLI_CONFIG_PATH
variable from its running env to determine its config file's path when -c
is not specified, and a DT_CONFIG_DIR
variable to determine a directory where the config file is searched. The expected behavior of dt-cli
will be:
- If
-c
is present, ignoreDT_CLI_CONFIG_PATH
andDT_CONFIG_DIR
- If
-c
is not present,dt-cli
will work like it is passed with-c $DT_CLI_CONFIG_PATH
(ifDT_CLI_CONFIG_PATH
is present) - Otherwise,
dt-cli
will try to load$DT_CONFIG_DIR/cli.toml
, and$DT_CONFIG_DIR/config.toml
if thecli.toml
does not exist (ifDT_CONFIG_DIR
is present) - When nothing (
-c
,DT_CLI_CONFIG_PATH
, orDT_CONFIG_DIR
) is present,dt-cli
will work as before (searchcli.toml
andconfig.toml
fromXDG_CONFIG_HOME
)
The reason I'm not using DT_CONFIG_PATH
to specify path to dt-cli
's config file is that there is a planned dt-server
(the name is not decided and could change) utility to be provided by this project, and I would like to preserve the DT_
namespace for some shared properties between dt-cli
and dt-server
. In the above case, when DT_CONFIG_DIR
is present, the future dt-server
utility will also find its config file from there, which will be $DT_CONFIG_DIR/server.toml
.
I'm certainly open to a feature that determines config path from environment variable(s)! I think it'll be included in the next release (in ~4 days) after I implement it. But if you'd like to open a pull request I'll also be happy to review and merge.
from dt.
Hi @etdr, this feature has been added in v0.7.5, you can now set value of DT_CLI_CONFIG_PATH
to your config file, or set value of DT_CONFIG_DIR
to the config file's parent directory to achieve this. E.g. DT_CLI_CONFIG_PATH=~/.path/to/file dt-cli [args]
.
All the best :)
from dt.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dt.