Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config file option does not work #21

Open
SebastianM-C opened this issue Jan 19, 2020 · 1 comment
Open

Config file option does not work #21

SebastianM-C opened this issue Jan 19, 2020 · 1 comment

Comments

@SebastianM-C
Copy link

Using the --config option does not seem to work.
MWE:

ztdns --config /etc/.ztdns.toml server
Error: no API key provided
Usage:
  ztdns server [flags]
Flags:
  -h, --help               help for server
      --interface string   interface to listen on
Global Flags:
      --config string   config file (default is $HOME/.ztdns.toml)
      --debug           enable debug messages
no API key provided

Running the program with strace indicates that it only looks in the default locations

getcwd("/home/user", 4096)              = 11
newfstatat(AT_FDCWD, "/home/user/.ztdns.json", 0xc0000adca8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.toml", 0xc0000add78, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.yaml", 0xc0000ade48, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.yml", 0xc0000adf18, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.properties", 0xc00013e038, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.props", 0xc00013e108, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.prop", 0xc00013e1d8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.hcl", 0xc00013e2a8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.dotenv", 0xc00013e378, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.env", 0xc00013e448, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns.ini", 0xc00013e518, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/home/user/.ztdns", 0xc00013e5e8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.json", 0xc00013e6b8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.toml", 0xc00013e788, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.yaml", 0xc00013e858, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.yml", 0xc00013e928, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.properties", 0xc00013e9f8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.props", 0xc00013eac8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.prop", 0xc00013eb98, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.hcl", 0xc00013ec68, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.dotenv", 0xc00013ed38, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.env", 0xc00013ee08, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns.ini", 0xc00013eed8, 0) = -1 ENOENT (No such file or directory)
newfstatat(AT_FDCWD, "/root/.ztdns", 0xc00013efa8, 0) = -1 ENOENT (No such file or directory)
write(2, "Error: no API key provided\n", 27Error: no API key provided
) = 27
@SebastianM-C
Copy link
Author

Looks like this was already reported here: #13

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

No branches or pull requests

1 participant