From c7f4200417ac07a51ac8ec3610e26dff5f253e32 Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Sun, 19 Aug 2018 11:24:48 -0700 Subject: [PATCH] Somewhat more robust mechanism to find unsupported Borg arguments. --- scripts/find-unsupported-borg-options | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/scripts/find-unsupported-borg-options b/scripts/find-unsupported-borg-options index cab633d..723aeff 100755 --- a/scripts/find-unsupported-borg-options +++ b/scripts/find-unsupported-borg-options @@ -22,22 +22,28 @@ for sub_command in prune create check list info; do sort borgmatic_borg_flags > borgmatic_borg_flags.sorted mv borgmatic_borg_flags.sorted borgmatic_borg_flags - for line in $(borg $sub_command --help | awk -v RS= '/^usage:/') ; do + for word in $(borg $sub_command --help | grep '^ -') ; do # Exclude a bunch of flags that borgmatic actually supports, but don't get exercised by the # generated sample config, and also flags that don't make sense to support. - echo "$line" | grep -- -- | sed -r 's/(\[|\])//g' \ - | grep -v '^-h$' \ + echo "$word" | grep ^-- | sed -e 's/,$//' \ | grep -v '^--archives-only$' \ + | grep -v '^--critical$' \ + | grep -v '^--debug$' \ + | grep -v '^--dry-run$' \ + | grep -v '^--error$' \ + | grep -v '^--help$' \ + | grep -v '^--info$' \ + | grep -v '^--list$' \ + | grep -v '^--nobsdflags$' \ + | grep -v '^--pattern$' \ | grep -v '^--repository-only$' \ | grep -v '^--stats$' \ - | grep -v '^--list$' \ - | grep -v '^--critical$' \ - | grep -v '^--error$' \ + | grep -v '^--verbose$' \ | grep -v '^--warning$' \ - | grep -v '^--info$' \ - | grep -v '^--debug$' \ + | grep -v '^-h$' \ >> all_borg_flags done + sort all_borg_flags > all_borg_flags.sorted mv all_borg_flags.sorted all_borg_flags