diff --git a/src/flags.lisp b/src/flags.lisp index 0c606cc..6eee7ea 100644 --- a/src/flags.lisp +++ b/src/flags.lisp @@ -38,9 +38,22 @@ (defparameter *option-setting* (adopt:make-option 'setting - :long "setting" - :parameter "SETTING" - :help "Add SETTING to the .system file(s)" - :manual "Add SETTING (an expression in the form Option=value) to the .system file being operated on. Multiple SETTINGs can be set by giving this option multiple times. Use 'Option=nil' to revoke a setting." - :initial-value nil - :reduce (adopt:flip #'cons))) + :long "setting" + :parameter "SETTING" + :help "Add SETTING to the .system file(s)" + :manual "Add SETTING (an expression in the form Option=value) to the .system file being operated on. Multiple SETTINGs can be set by giving this option multiple times. Use 'Option=nil' to revoke a setting." + :initial-value nil + :reduce (adopt:flip #'cons))) + + +(defparameter *option-backup* + (adopt:make-option 'backup + :parameter "LOCATION" + :long "backup" + :short #\b + :help "Back up file to LOCATION before editing." + :manual "Back up FILE to LOCATION before editiong. If no LOCATION is given, default to backing up at ./.service-backup" + :initial-value nil + :reduce (lambda (prev new) + (declare (ignore prev)) + new))) diff --git a/src/main.lisp b/src/main.lisp index ad20597..e8fb89e 100644 --- a/src/main.lisp +++ b/src/main.lisp @@ -36,6 +36,7 @@ (adopt:exit)) (run (first arguments) :direct-settings (gethash 'setting options) - :secure (gethash 'secure options))) + :secure (gethash 'secure options) + :backup (gethash 'backup options))) (error (c) (adopt:print-error-and-exit c)))) diff --git a/src/ui.lisp b/src/ui.lisp index 176288a..a4cc5ed 100644 --- a/src/ui.lisp +++ b/src/ui.lisp @@ -33,4 +33,5 @@ *option-help* *option-secure* *option-version* - *option-setting*))) + *option-setting* + *option-backup*))) diff --git a/test/test.service b/test/test.service index 95ee20e..0022703 100644 --- a/test/test.service +++ b/test/test.service @@ -22,5 +22,3 @@ NewBinding=Yes [Install] Alias=dbus.service -ervice -