SR-G / sleep-on-lan

Multi-platform process allowing to sleep on LAN a linux or windows computer, through wake-on-lan (reversed) magic packets or through HTTP REST requests.
Apache License 2.0
332 stars 25 forks source link

Add --config in order to allow usage of another configuration file #10

Closed SR-G closed 3 years ago

SR-G commented 6 years ago

Add a --config parameter. See if it is worth switching to the regular spf13/cobra framework.

lkd70 commented 6 years ago

At the moment I just do: ./sol configfilename.json It's not ideal, but was easier to implement than relying on another package to handle command line argument parsing.

    var fullConfigurationFileName string
    if (len(os.Args) >= 1) {
        fullConfigurationFileName = dir + string(os.PathSeparator) + os.Args[1]
    } else {
        fullConfigurationFileName = dir + string(os.PathSeparator) + configurationFileName
    }

BotchJob

SR-G commented 3 years ago

Implemented in 1.0.6-SNAPSHOT