feat[flags] Added backup functionality
This commit is contained in:
parent
62b11f439b
commit
b2198bd934
@ -38,9 +38,22 @@
|
|||||||
|
|
||||||
(defparameter *option-setting*
|
(defparameter *option-setting*
|
||||||
(adopt:make-option 'setting
|
(adopt:make-option 'setting
|
||||||
:long "setting"
|
:long "setting"
|
||||||
:parameter "SETTING"
|
:parameter "SETTING"
|
||||||
:help "Add SETTING to the .system file(s)"
|
: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."
|
: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
|
:initial-value nil
|
||||||
:reduce (adopt:flip #'cons)))
|
: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)))
|
||||||
|
@ -36,6 +36,7 @@
|
|||||||
(adopt:exit))
|
(adopt:exit))
|
||||||
(run (first arguments)
|
(run (first arguments)
|
||||||
:direct-settings (gethash 'setting options)
|
:direct-settings (gethash 'setting options)
|
||||||
:secure (gethash 'secure options)))
|
:secure (gethash 'secure options)
|
||||||
|
:backup (gethash 'backup options)))
|
||||||
(error (c)
|
(error (c)
|
||||||
(adopt:print-error-and-exit c))))
|
(adopt:print-error-and-exit c))))
|
||||||
|
@ -33,4 +33,5 @@
|
|||||||
*option-help*
|
*option-help*
|
||||||
*option-secure*
|
*option-secure*
|
||||||
*option-version*
|
*option-version*
|
||||||
*option-setting*)))
|
*option-setting*
|
||||||
|
*option-backup*)))
|
||||||
|
@ -22,5 +22,3 @@ NewBinding=Yes
|
|||||||
[Install]
|
[Install]
|
||||||
Alias=dbus.service
|
Alias=dbus.service
|
||||||
|
|
||||||
ervice
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user