jantman / pydnstest

ABANDONED - Python tool for testing DNS changes (add, remove, rename, change records) against a staging DNS server, verifying the same changes against production, or confirming that a record returns the same result in both environments.
GNU Affero General Public License v3.0
11 stars 1 forks source link

option to print an example configuration #7

Closed jantman closed 10 years ago

jantman commented 10 years ago

right now there's a config file example in the package/repo, and that's copied into the readme. make an option to just dump an example config file to stdout and then exit.

include a comment in the output about how to do output redirection?

jantman commented 10 years ago

This should include some work in the Config module to make it easier to mock configs in testing too. What I'm thinking of is:

config class starts with default/example configuration includes to_string and to_dict methods (mainly for testing), as well as a write_config(path) method the command line options should be: --configprint - print the current config (or example if that's it) --promptconfig - interactive prompting to create a new config file

if no config file is found, message should mention --promptconfig

jantman commented 10 years ago

--exampleconf option added config class now has both good starting defaults, and a set_example_values() method asDict() method already existed added to_string() method that returns the config as a formatted string, including comments

just need to implement --configprint and --promptconfig