feat[flags] Added backup functionality

This commit is contained in:
Judah Sotomayor 2023-12-20 11:38:13 -05:00
parent 62b11f439b
commit b2198bd934
Signed by: judahsotomayor
SSH Key Fingerprint: SHA256:9Dq4ppxhfAjbX+7HLXEt+ROMiIojI6kqQgUyFUJb9lI
4 changed files with 23 additions and 10 deletions

View File

@ -44,3 +44,16 @@
: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)))

View File

@ -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))))

View File

@ -33,4 +33,5 @@
*option-help*
*option-secure*
*option-version*
*option-setting*)))
*option-setting*
*option-backup*)))

View File

@ -22,5 +22,3 @@ NewBinding=Yes
[Install]
Alias=dbus.service
ervice