aligator / GoSlice

This is an experimental slicer for 3d printing written in Go also usable as modular slicing lib.
Apache License 2.0
99 stars 16 forks source link

Load Options from file #46

Open galamdring opened 2 years ago

galamdring commented 2 years ago

Being able to store custom settings in files would be a first step toward supporting profiles for different printers/filaments.

Implementation would look like adding a command line flag that loads into a struct that has a set method that configures all of the options.

YAML would be a solid format for this, and many apps are moving in this direction for configuration files.

aligator commented 2 years ago

Thanks for the suggestion :-) For this I would suggest to use https://github.com/spf13/viper it supports different filetypes, including yaml. (from the same dev as github.com/spf13/pflag which I also use in this project for the cli options. Maybe these can be combined in a nice way.) Important is that the command line usage is kept the same to avoid breaking changes (for now) (at least one project I know of calls GoSlice through command line options.)