diff --git a/fr.po b/fr.po index 851fbc2..7ed5be5 100644 --- a/fr.po +++ b/fr.po @@ -197,8 +197,11 @@ msgid "force overwriting of existing files" msgstr "force le remplacement des fichiers déjà existants" #: gcp:545 -msgid "preserve the specified attributes" -msgstr "garde les attributs spécifiés" +#, python-format +msgid "preserve the specified attributes; accepted values:\ +'all', or one or more amongst %s" +msgstr "garde les attributs spécifiés; valeurs acceptées : 'all' ou\ +un ou plusieurs éléments parmi %s" #: gcp:551 msgid "don't fix filesystem name incompatibily" @@ -245,12 +248,9 @@ msgid "Progress bar is not available, deactivating" msgstr "La barre de progression n'est pas disponible, désactivation" #: gcp:595 -msgid "" -"Invalid --preserve value\n" -"valid values are:" -msgstr "" -"La valeur de «--preserve» est invalide\n" -"Les valeurs valides sont:" +#, python-format +msgid "Invalid --preserve value '%s'" +msgstr "Valeur de --preserve invalide « %s »" #: gcp:616 #, python-format diff --git a/gcp b/gcp index 9ed8fd1..a6d7c47 100755 --- a/gcp +++ b/gcp @@ -566,7 +566,8 @@ class GCP(): ) parser.add_argument("--preserve", action="store", default='', - help=_("preserve the specified attributes") + help=_("preserve the specified attributes; accepted values:\ + 'all', or one or more amongst %s") % str(const_PRESERVE) ) parser.add_argument("-L", "--dereference", action="store_true", default=False, @@ -646,22 +647,26 @@ class GCP(): if options.no_fs_fix: options.fs_fix = 'no' + preserve = set() + if options.p: - if not options.preserve: - options.preserve = const_PRESERVE_p - else: - options.preserve += ',' + const_PRESERVE_p + preserve.update(const_PRESERVE_p.split(',')) if options.preserve: - preserve = set(options.preserve.split(',')) - if not preserve.issubset(const_PRESERVE): - error (_("Invalid --preserve value\nvalid values are:")) - for value in const_PRESERVE: - error('- %s' % value) - exit(1) - options.preserve = preserve - else: - options.preserve = set() + preserve.update(options.preserve.split(',')) + preserve_all = False + for value in preserve: + if value == 'all': + preserve_all = True + continue + if value not in const_PRESERVE: + error (_("Invalid --preserve value '%s'") % value) + exit(1) + if preserve_all: + preserve.remove('all') + preserve.update(const_PRESERVE) + + options.preserve = preserve self.__sourcesSaving(options, args) diff --git a/gcp.po b/gcp.po index 6ab447d..335adce 100644 --- a/gcp.po +++ b/gcp.po @@ -120,7 +120,9 @@ msgid "force overwriting of existing files" msgstr "" #: gcp:321 -msgid "preserve the specified attributes" +#, python-format +msgid "preserve the specified attributes; accepted values:\ +'all', or one or more amongst %s" msgstr "" #: gcp:324 @@ -140,9 +142,8 @@ msgid "Progress bar is not available, deactivating" msgstr "" #: gcp:345 -msgid "" -"Invalid --preserve value\n" -"valid values are:" +#, python-format +msgid "Invalid --preserve value '%s'" msgstr "" #: gcp:354