@startuml Config Activity Diagram start floating note The ""config"" command gets or sets options in a config file. Example for getting an option: ""config "" Example for setting an option: ""config "" end note if (""--file "" specified?) then (yes) :Use ""--file "" value; else (no) :Use default location; note left Default locations change based on the OS the program is executed on. e.g. ""$XDG_CONFIG_HOME/Window Layout Manager/config"" on Unix or ""%APPDATA%/Window Layout Manager/config"" on Windows end note endif partition "Validate config path" { if (Is path a file?) then (yes) if (Does file exist?) then (yes) :Parse file; if (Is valid?) then (yes) else (no) :Print error; end endif else (no) :Instantiate default config; endif else (no) :Print error; end endif } if (Is """" value specified?) then (yes) if (Is """" value specified?) then (yes) :Set """" value; :Update config file; note right If file does not exist create it (recursively). end note else (no) :Print existing ""config-option"" value; endif else (no) :Print existing config; endif end @enduml