diff -Nru hizoselect-3.1.5/debian/changelog hizoselect-3.1.7/debian/changelog --- hizoselect-3.1.5/debian/changelog 2021-07-10 09:10:00.000000000 +0000 +++ hizoselect-3.1.7/debian/changelog 2021-08-22 16:00:00.000000000 +0000 @@ -1,3 +1,29 @@ +hizoselect (3.1.7-0~impish) impish; urgency=low () + + [english] + Gathering of some arguments at code level (no modification for the user). + If no argument (%[a-Z]) is specified with the proposals, use %t by default. + --bar: Add a check on the letters used. + --uniq-item: Need to specify the argument (%[a-Z]) to use. + + [français] + Rassemblements de certains arguments au niveau code (pas de modification pour l'utilisateur). + Si aucun argument (%[a-Z]) n'est précisé avec les propositions, utilisation de %t par défaut. + --bar : Ajout d'une vérification sur les lettres utilisées. + --uniq-item : Nécessite de préciser l'argument (%[a-Z]) à utiliser. + + -- Terence Belléguic Sun, 22 Aug 2021 18:00:00 +0200 + +hizoselect (3.1.6-0~impish) impish; urgency=low () + + [english] + --default "*" / --force "*" corrected. + + [français] + Correction de --default "*" / --force "*". + + -- Terence Belléguic Sat, 10 Jul 2021 12:00:00 +0200 + hizoselect (3.1.5-0~impish) impish; urgency=low () [english] diff -Nru hizoselect-3.1.5/fr/hizoselect.po hizoselect-3.1.7/fr/hizoselect.po --- hizoselect-3.1.5/fr/hizoselect.po 2021-07-09 13:28:01.000000000 +0000 +++ hizoselect-3.1.7/fr/hizoselect.po 2021-08-22 16:20:51.000000000 +0000 @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: 1\n" "Report-Msgid-Bugs-To: hizo@free.fr\n" -"POT-Creation-Date: 2021-07-09 15:27+0200\n" +"POT-Creation-Date: 2021-08-22 18:19+0200\n" "PO-Revision-Date: 2017-09-28 15:30+0200\n" "Last-Translator: Belleguic Terence aka Hizo \n" "Language-Team: \n" @@ -19,35 +19,35 @@ "X-Generator: Poedit 2.0.1\n" #. TranslationAssistance ==============================> Texts of the errors -#: hizoselect:1009 +#: hizoselect:1019 msgid "The %s argument needs a value." msgstr "L'argument %s nécessite une valeur." -#: hizoselect:1010 +#: hizoselect:1020 msgid "The number %s is out of selection." msgstr "Le nombre %s est hors sélection." -#: hizoselect:1011 +#: hizoselect:1021 msgid "%s: %s is not an accepted value." msgstr "%s : %s n'est pas une valeur acceptée." -#: hizoselect:1012 +#: hizoselect:1022 msgid "%s: %s is not in the proposals list." msgstr "%s : %s n'est pas dans la liste des propositions." -#: hizoselect:1013 +#: hizoselect:1023 msgid "%s: The number of values is greater than the number of items." msgstr "%s : Le nombre de valeur est plus élevé que le nombre de proposition." -#: hizoselect:1014 +#: hizoselect:1024 msgid "%s: Impossible to use %s because %s mode is disabled." msgstr "%s : Impossible d'utiliser %s car le mode %s est désactivé." -#: hizoselect:1015 +#: hizoselect:1025 msgid "%s: Impossible to associate * with another value." msgstr "%s : Impossible de coupler * avec une autre valeur." -#: hizoselect:1016 +#: hizoselect:1026 msgid "" "The effects are define by a number between 0 and 255 for effects or by bold " "dim smul smso." @@ -55,162 +55,162 @@ "Les effets sont définis par un nombre entre 0 et 255 pour les couleurs ou " "par bold dim smul smso." -#: hizoselect:1017 +#: hizoselect:1027 msgid "%s: file not founded." msgstr "%s : fichier introuvable." -#: hizoselect:1018 +#: hizoselect:1028 msgid "The input argument must have %%n." msgstr "L'argument input nécessite obligatoirement l'utilisation de %%n." -#: hizoselect:1019 +#: hizoselect:1029 msgid "Insufficient number of items." msgstr "Nombre de proposition insuffisant." -#: hizoselect:1020 +#: hizoselect:1030 msgid "%s key isn't usable." msgstr "La touche %s n'est pas utilisable." -#: hizoselect:1021 +#: hizoselect:1031 msgid "Maximum limit reached." msgstr "Limite maximale atteinte." -#: hizoselect:1022 +#: hizoselect:1032 msgid "Number of answer insufficient." msgstr "Nombre de réponse insufisant." -#: hizoselect:1023 +#: hizoselect:1033 msgid "The --min value cannot be greater than the --max value." msgstr "La valeur de --min ne peut être plus grande que celle de --max." -#: hizoselect:1024 +#: hizoselect:1034 msgid "%s: - needs a MIN value before and a MAX value after." msgstr "%s : - nécessite une valeur MIN avant et une valeur MAX après." -#: hizoselect:1025 +#: hizoselect:1035 msgid "The second number must be greater than the first." msgstr "Le 2ème nombre doit être plus grand que le 1er." -#: hizoselect:1026 +#: hizoselect:1036 msgid "The range needs a second number." msgstr "La plage nécessite un 2ème nombre." -#: hizoselect:1027 +#: hizoselect:1037 msgid "The range will exceed the maximum answer number." msgstr "La plage excédera la limite du nombre de réponse." -#: hizoselect:1028 +#: hizoselect:1038 msgid "A number must precede the - sign." msgstr "Un nombre doit obligatoirement précéder le signe -." -#: hizoselect:1029 +#: hizoselect:1039 msgid "Impossible to add more - signs." msgstr "Impossible de cumuler les signes -." -#: hizoselect:1030 +#: hizoselect:1040 msgid "This value range will unnecessarily duplicate." msgstr "Cette nouvelle plage va faire doublon." -#: hizoselect:1031 +#: hizoselect:1041 msgid "The %s argument is unknow." msgstr "L'argument %s est inconnu." -#: hizoselect:1032 +#: hizoselect:1042 msgid "%s number already entered." msgstr "Nombre %s déjà inscrit." -#: hizoselect:1033 +#: hizoselect:1043 msgid "Please explain to hizo@free.fr how this error happened." msgstr "Merci d'indiquer ce que vous avez fait à hizo@free.fr." -#: hizoselect:1034 +#: hizoselect:1044 msgid "%s: A number cannot start by 0." msgstr "%s : Un nombre ne peut commencer par 0." #. TranslationAssistance ==============================> Texts -#: hizoselect:1037 +#: hizoselect:1047 msgid "Selection: " msgstr "Sélection : " -#: hizoselect:1038 +#: hizoselect:1048 msgid "One expected answer" msgid_plural "%d expected answers" msgstr[0] "Une réponse attendue" msgstr[1] "%d réponses attendues" -#: hizoselect:1039 +#: hizoselect:1049 msgid "Between %s and %s expected answers" msgstr "Entre %s et %s réponses attendues" -#: hizoselect:1040 +#: hizoselect:1050 msgid "Minimum of %d expected answer" msgid_plural "Minimum of %d expected answers" msgstr[0] "Minimum d'%d réponse attendue" msgstr[1] "Minimum de %d réponses attendues" -#: hizoselect:1041 +#: hizoselect:1051 msgid "Maximum of %d expected answer" msgid_plural "Maximum of %d expected answers" msgstr[0] "Maximum d'%d réponse attendue" msgstr[1] "Maximum de %d réponses attendues" -#: hizoselect:1042 +#: hizoselect:1052 msgid "Answer" msgstr "Réponse" #. TranslationAssistance ==============================> Texts of the dynamic help -#: hizoselect:1046 +#: hizoselect:1056 msgid "Help with the use of HizoSelect" msgstr "Aide à l'utilisation de HizoSelect" -#: hizoselect:1047 +#: hizoselect:1057 msgid "Number of expected answers:" msgstr "Nombre de réponses attendues :" -#: hizoselect:1048 +#: hizoselect:1058 msgid "Possible answers:" msgstr "Réponses possibles :" -#: hizoselect:1049 +#: hizoselect:1059 msgid "The numbers select their items." msgstr "Les nombres renvoient les valeurs correspondantes." -#: hizoselect:1050 +#: hizoselect:1060 msgid "The ? select random items." msgstr "Les ? renvoient des valeurs aléatoires." -#: hizoselect:1051 +#: hizoselect:1061 msgid "" "The range select items starts from the first number to the second number " "included." msgstr "Les plages de valeurs renvoient les valeurs entre x et y compris." -#: hizoselect:1052 +#: hizoselect:1062 msgid "The * select all items." msgstr "Le * renvoie toutes les valeurs" -#: hizoselect:1053 +#: hizoselect:1063 msgid "Press any key for exiting the help." msgstr "Appuyer sur une touche pour quitter l'aide." -#: hizoselect:1054 +#: hizoselect:1064 msgid "It's possible to select several times a same item." msgstr "Il est possible de sélectionner plusieurs fois une même valeur." -#: hizoselect:1055 +#: hizoselect:1065 msgid "Each item can be only select one time." msgstr "Chaque proposition ne peut être sélectionnée qu'une seule fois." -#: hizoselect:1056 +#: hizoselect:1066 msgid "Information:" msgstr "Information :" #. TranslationAssistance ==============================> Texts of the help argument -#: hizoselect:1060 +#: hizoselect:1070 msgid "Options:" msgstr "Options :" -#: hizoselect:1061 +#: hizoselect:1071 msgid "" "Effects of actions, commentaries, errors, numbers, prompt text, secret " "texts, texts and title." @@ -218,7 +218,7 @@ "Effets des actions, commentaires, des erreurs, des nombres, du texte du " "prompt, des textes secrets, des textes et du titre." -#: hizoselect:1062 +#: hizoselect:1072 msgid "" "Enabled actions on start. If the action is visible in the bar, the user can " "change it." @@ -226,136 +226,136 @@ "Actions actives au démarrage. Si l'action est visible dans la barre, " "l'utilisateur peut la modifier." -#: hizoselect:1063 +#: hizoselect:1073 msgid "Hides error messages." msgstr "Cache les messages d'erreur." -#: hizoselect:1064 +#: hizoselect:1074 msgid "Pre-filled answers." msgstr "Réponses pré-rentrées." -#: hizoselect:1065 +#: hizoselect:1075 msgid "Demonstration of commands." msgstr "Démonstration de commandes." -#: hizoselect:1066 +#: hizoselect:1076 msgid "Displays this help." msgstr "Affiche cette aide" -#: hizoselect:1067 +#: hizoselect:1077 msgid "Mandatory answers." msgstr "Réponses obligatoires." -#: hizoselect:1068 +#: hizoselect:1078 msgid "Format of the items." msgstr "Formatage des propositions." -#: hizoselect:1069 +#: hizoselect:1079 msgid "Maximal number of answers." msgstr "Nombre maximal de réponse attendue." -#: hizoselect:1070 +#: hizoselect:1080 msgid "Minimal number of answers." msgstr "Nombre minimal de réponse attendue." -#: hizoselect:1071 +#: hizoselect:1081 msgid "Allows to return the same answer several times." msgstr "Permets de renvoyer plusieurs fois la même réponse." -#: hizoselect:1072 +#: hizoselect:1082 msgid "Enables the use of symbols in the answers." msgstr "Active l'utilisation des symboles dans les réponses." -#: hizoselect:1073 +#: hizoselect:1083 msgid "Displayed text between the title and the list of items." msgstr "Texte affiché entre le titre et la liste de propositions." -#: hizoselect:1074 -msgid "Sort the proposals by value choiced." -msgstr "Range les propositions par la valeur choisie." +#: hizoselect:1084 +msgid "Sort the proposals by the choiced argument." +msgstr "Range les propositions de l'argument choisi." -#: hizoselect:1075 +#: hizoselect:1085 msgid "Format of the returned answers." msgstr "Formatage des réponses retournées." -#: hizoselect:1076 +#: hizoselect:1086 msgid "Displayed text while waiting for the choice." msgstr "Texte affiché lors de l'attente de réponse." -#: hizoselect:1077 +#: hizoselect:1087 msgid "First displayed text like a title." msgstr "Premier texte affiché comme un titre." -#: hizoselect:1078 -msgid "Avoids redundant items." -msgstr "Empêche les propositions doublons." +#: hizoselect:1088 +msgid "Delete redundant items by the choiced argument." +msgstr "Supprime les propositions en doublon de l'argument choisi." -#: hizoselect:1079 +#: hizoselect:1089 msgid "Version of the hizoselect command." msgstr "Version de la commande hizoselect" -#: hizoselect:1080 +#: hizoselect:1090 msgid "Examples:" msgstr "Exemples :" -#: hizoselect:1081 +#: hizoselect:1091 msgid "More informations:" msgstr "Plus d'informations :" -#: hizoselect:1082 +#: hizoselect:1092 msgid "item(s) " msgstr "proposition(s)" -#: hizoselect:1083 +#: hizoselect:1093 msgid "int " msgstr "entier" -#: hizoselect:1084 +#: hizoselect:1094 msgid "text " msgstr "texte" -#: hizoselect:1085 +#: hizoselect:1095 msgid "Management of the content of the bar and its actions." msgstr "Gestion du contenu de la barre et de ses actions." -#: hizoselect:1086 +#: hizoselect:1096 msgid "Disables all modes: all, range and random." msgstr "Désactive tous les modes : all, range et random." -#: hizoselect:1087 +#: hizoselect:1097 msgid "Delimiter to use between of the returned items." msgstr "Délimiteur à utiliser entre les propositions retournées." -#: hizoselect:1088 +#: hizoselect:1098 msgid "Text to add in the help screen." msgstr "Texte additionnel à afficher dans l'aide." -#: hizoselect:1089 +#: hizoselect:1099 msgid "HizoSelect command help" msgstr "Aide de la commande HizoSelect" -#: hizoselect:1090 +#: hizoselect:1100 msgid "Name of the command displayed in error messages." msgstr "Nom de la commande affichée dans les messages d'erreurs." -#: hizoselect:1091 +#: hizoselect:1101 msgid "Clear the terminal before display the texts." msgstr "Nettoyer le terminal avant d'afficher les textes." -#: hizoselect:1092 +#: hizoselect:1102 msgid "file" msgstr "fichier" -#: hizoselect:1093 +#: hizoselect:1103 msgid "Load a config file who contains some values." msgstr "Charge un fichier de config contenant divers valeurs." #. TranslationAssistance ==============================> Texts of the examples -#: hizoselect:1097 +#: hizoselect:1107 msgid "What example(s) do you want see?" msgstr "Quel(s) exemple(s) veux-tu voir ?" -#: hizoselect:1098 +#: hizoselect:1108 msgid "" "%t=Would you marry me? %c=One number by default with a limit to 1 item and " "output change" @@ -363,14 +363,14 @@ "%t=Veux-tu m'épouser ? %c=Une valeur par défaut avec un maximum d'une " "réponse et le format de sorti modifié" -#: hizoselect:1099 +#: hizoselect:1109 msgid "" "%t=Choose your menu %c=All by default with a input number for read command" msgstr "" "%t=Choisis ton menu %c=Tout (All) par défaut avec un numéro d'input pour la " "commande read" -#: hizoselect:1100 +#: hizoselect:1110 msgid "" "%t=Write the name 'Belleguic' %c=Numbers by default with columns format and " "several mode enable" @@ -378,7 +378,7 @@ "%t=Écris le nom 'Belleguic' %c=Nombres par défaut au format colonnes et mode " "several activé" -#: hizoselect:1101 +#: hizoselect:1111 msgid "" "%t=What can be the age of a minor? %c=Range by default with no-all and no-" "random" @@ -386,100 +386,100 @@ "%t=Quel peut-être l'âge d'un mineur ? %c=Plage par défaut avec no-all et no-" "random" -#: hizoselect:1102 +#: hizoselect:1112 msgid "" "%t=I remove duplicates for you %c=Uniq item option and prompt text change" msgstr "" "%t=Je supprime les doublons pour toi %c=Option de proposition unique et " "texte du prompt modifié" -#: hizoselect:1103 +#: hizoselect:1113 msgid "%t=Advanced input/output argument %c=How-to use format" msgstr "%t=Arguments input/output avancés %c=Comment utiliser le format" -#: hizoselect:1104 +#: hizoselect:1114 msgid "%t=Traitment of files in a for loop %c=How-to use returns with for loop" msgstr "" "%t=Traiter les fichier choisis dans une boucle for %c=Comment utiliser les " "retours avec une boucle for" -#: hizoselect:1105 +#: hizoselect:1115 msgid "%t=Use multi read %c=How-to use multi while read loop" msgstr "%t=Utiliser plusieurs read %c=Comment cumuler les boucles read" -#: hizoselect:1106 +#: hizoselect:1116 msgid "Command:" msgstr "Commande :" -#: hizoselect:1107 +#: hizoselect:1117 msgid "Would you marry me?" msgstr "Veux-tu m'épouser ?" -#: hizoselect:1108 +#: hizoselect:1118 msgid "The number %n is %t (%c) and his secret value is %s." msgstr "Le nombre %n est %t (%c) et sa valeur secréte est %s." -#: hizoselect:1109 +#: hizoselect:1119 msgid "%t=Yes %c=I want it! %s=y" msgstr "%t=Oui %c=Je le veux! %s=y" -#: hizoselect:1110 +#: hizoselect:1120 msgid "%t=No %c=Sorry... %s=n" msgstr "%t=Non %c=Désolé... %s=n" -#: hizoselect:1111 +#: hizoselect:1121 msgid "I want eat a %t" msgstr "Je veux manger un %t" -#: hizoselect:1112 +#: hizoselect:1122 msgid "Choose your menu (All by default):" msgstr "Choisi ton menu (Tout par défaut) :" -#: hizoselect:1113 +#: hizoselect:1123 msgid "%t=Entry %c=Vegetables" msgstr "%t=Entrée %c=Crudités" -#: hizoselect:1114 +#: hizoselect:1124 msgid "%t=Dish %c=Steak and fries" msgstr "%t=Plat %c=Steak et frites" -#: hizoselect:1115 +#: hizoselect:1125 msgid "%t=Dessert %c=Flan" msgstr "%t=Dessert %c=Flan" -#: hizoselect:1116 +#: hizoselect:1126 msgid "Write the name 'Belleguic' (Numbers by default)" msgstr "Écris le nom 'Belleguic' (Nombres par défaut)" -#: hizoselect:1117 +#: hizoselect:1127 msgid "You write:" msgstr "Tu écris :" -#: hizoselect:1118 +#: hizoselect:1128 msgid "What can be the age of a minor?" msgstr "Quel peut être l'âge d'un mineur ?" -#: hizoselect:1119 +#: hizoselect:1129 msgid "A minor may be aged: %s years" msgstr "Un mineur peut être agé de : %s ans" -#: hizoselect:1120 +#: hizoselect:1130 msgid "I remove duplicates for you:" msgstr "Je supprime les doublons pour toi :" -#: hizoselect:1121 +#: hizoselect:1131 msgid "You have choiced: %t" msgstr "Tu as choisi: %t" -#: hizoselect:1122 +#: hizoselect:1132 msgid "I wait after you:" msgstr "J'attends après toi :" -#: hizoselect:1123 +#: hizoselect:1133 msgid "Advanced input/output argument:" msgstr "Arguments input/output avancés" -#: hizoselect:1124 +#: hizoselect:1134 msgid "" "[%n] (mandatory) <%t and %c and %s (text and commentary and secret text)|%t " "and %c (text and commentary)|%t and %s (text and secret text)|%c and %s " @@ -489,7 +489,7 @@ "et %c (texte et commentaire)|%t et %s (texte et texte secret)|%c et %s " "(commentaire et texte secret)|%t (texte)|%c (commentaire)|%s (texte secret)>" -#: hizoselect:1125 +#: hizoselect:1135 msgid "" "\\<%n\\> (always exists) \\| <%t and %c and %s (text and commentary and " "secret text)|%t and %c (text and commentary)|%t and %s (text and secret " @@ -501,101 +501,104 @@ "secret )|%c et %s (commentaire et texte secret)|%t (texte)|%c (commentaire)|" "%s (texte secret)>" -#: hizoselect:1126 +#: hizoselect:1136 msgid "Select the files to update" msgstr "Choisir les fichiers à mettre à jour" -#: hizoselect:1127 +#: hizoselect:1137 msgid "I choosen %s." msgstr "J'ai choisi %s." -#: hizoselect:1128 +#: hizoselect:1138 msgid "%t=Select software to install %c=Use the secret text" msgstr "%t=Choisir les logiciels à installer %c=Utilisation du texte secret" -#: hizoselect:1129 +#: hizoselect:1139 msgid "%t=Select women as you know %c=Create an array indexed" msgstr "" "%t=Indiquez les femmes que vous connaissez %c=Création d'un tableau indexé" -#: hizoselect:1130 +#: hizoselect:1140 msgid "Select software to install" msgstr "Choisir les logiciels à installer" -#: hizoselect:1131 +#: hizoselect:1141 msgid "Select women as you know" msgstr "Indiquez les femmes que vous connaissez" #. TranslationAssistance ==============================> h letter for help -#: hizoselect:1135 +#: hizoselect:1145 msgid "h" msgstr "a" -#: hizoselect:1136 +#: hizoselect:1146 msgid "Help" msgstr "Aide" #. TranslationAssistance ==============================> c letter for effects -#: hizoselect:1138 +#: hizoselect:1148 msgid "c" msgstr "e" -#: hizoselect:1139 +#: hizoselect:1149 msgid "Enable effects" msgstr "Activer effets" -#: hizoselect:1140 +#: hizoselect:1150 msgid "Disable effects" msgstr "Désactiver effets" #. TranslationAssistance ==============================> v letter for view -#: hizoselect:1142 +#: hizoselect:1152 msgid "v" msgstr "c" -#: hizoselect:1143 +#: hizoselect:1153 msgid "View in columns" msgstr "Voir en colonnes" -#: hizoselect:1144 +#: hizoselect:1154 msgid "View in lines" msgstr "Voir en lignes" #. TranslationAssistance ==============================> d letter for debug -#: hizoselect:1146 +#: hizoselect:1156 msgid "d" msgstr "d" -#: hizoselect:1147 +#: hizoselect:1157 msgid "Enable debug" msgstr "Activer le debogage" -#: hizoselect:1148 +#: hizoselect:1158 msgid "Disable debug" msgstr "Désactiver le debogage" #. TranslationAssistance ==============================> l letter for lang -#: hizoselect:1150 +#: hizoselect:1160 msgid "l" msgstr "l" -#: hizoselect:1151 +#: hizoselect:1161 msgid "French translation" msgstr "Traduction française" -#: hizoselect:1152 +#: hizoselect:1162 msgid "English translation" msgstr "Traduction anglaise" #. TranslationAssistance ==============================> e letter for exit -#: hizoselect:1154 +#: hizoselect:1164 msgid "e" msgstr "q" -#: hizoselect:1155 +#: hizoselect:1165 msgid "Exit" msgstr "Quitter" +#~ msgid "Avoids redundant items." +#~ msgstr "Empêche les propositions doublons." + #~ msgid "" #~ "To translate the question and the proposals, launch: LANGUAGE=en " #~ "hizoselect --ex" diff -Nru hizoselect-3.1.5/fr/hizoselect.pot hizoselect-3.1.7/fr/hizoselect.pot --- hizoselect-3.1.5/fr/hizoselect.pot 2021-07-09 13:27:59.000000000 +0000 +++ hizoselect-3.1.7/fr/hizoselect.pot 2021-08-22 16:19:34.000000000 +0000 @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: hizoselect\n" "Report-Msgid-Bugs-To: hizo@free.fr\n" -"POT-Creation-Date: 2021-07-09 15:27+0200\n" +"POT-Creation-Date: 2021-08-22 18:19+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -19,456 +19,456 @@ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n" #. TranslationAssistance ==============================> Texts of the errors -#: hizoselect:1009 +#: hizoselect:1019 msgid "The %s argument needs a value." msgstr "" -#: hizoselect:1010 +#: hizoselect:1020 msgid "The number %s is out of selection." msgstr "" -#: hizoselect:1011 +#: hizoselect:1021 msgid "%s: %s is not an accepted value." msgstr "" -#: hizoselect:1012 +#: hizoselect:1022 msgid "%s: %s is not in the proposals list." msgstr "" -#: hizoselect:1013 +#: hizoselect:1023 msgid "%s: The number of values is greater than the number of items." msgstr "" -#: hizoselect:1014 +#: hizoselect:1024 msgid "%s: Impossible to use %s because %s mode is disabled." msgstr "" -#: hizoselect:1015 +#: hizoselect:1025 msgid "%s: Impossible to associate * with another value." msgstr "" -#: hizoselect:1016 +#: hizoselect:1026 msgid "" "The effects are define by a number between 0 and 255 for effects or by bold " "dim smul smso." msgstr "" -#: hizoselect:1017 +#: hizoselect:1027 msgid "%s: file not founded." msgstr "" -#: hizoselect:1018 +#: hizoselect:1028 msgid "The input argument must have %%n." msgstr "" -#: hizoselect:1019 +#: hizoselect:1029 msgid "Insufficient number of items." msgstr "" -#: hizoselect:1020 +#: hizoselect:1030 msgid "%s key isn't usable." msgstr "" -#: hizoselect:1021 +#: hizoselect:1031 msgid "Maximum limit reached." msgstr "" -#: hizoselect:1022 +#: hizoselect:1032 msgid "Number of answer insufficient." msgstr "" -#: hizoselect:1023 +#: hizoselect:1033 msgid "The --min value cannot be greater than the --max value." msgstr "" -#: hizoselect:1024 +#: hizoselect:1034 msgid "%s: - needs a MIN value before and a MAX value after." msgstr "" -#: hizoselect:1025 +#: hizoselect:1035 msgid "The second number must be greater than the first." msgstr "" -#: hizoselect:1026 +#: hizoselect:1036 msgid "The range needs a second number." msgstr "" -#: hizoselect:1027 +#: hizoselect:1037 msgid "The range will exceed the maximum answer number." msgstr "" -#: hizoselect:1028 +#: hizoselect:1038 msgid "A number must precede the - sign." msgstr "" -#: hizoselect:1029 +#: hizoselect:1039 msgid "Impossible to add more - signs." msgstr "" -#: hizoselect:1030 +#: hizoselect:1040 msgid "This value range will unnecessarily duplicate." msgstr "" -#: hizoselect:1031 +#: hizoselect:1041 msgid "The %s argument is unknow." msgstr "" -#: hizoselect:1032 +#: hizoselect:1042 msgid "%s number already entered." msgstr "" -#: hizoselect:1033 +#: hizoselect:1043 msgid "Please explain to hizo@free.fr how this error happened." msgstr "" -#: hizoselect:1034 +#: hizoselect:1044 msgid "%s: A number cannot start by 0." msgstr "" #. TranslationAssistance ==============================> Texts -#: hizoselect:1037 +#: hizoselect:1047 msgid "Selection: " msgstr "" -#: hizoselect:1038 +#: hizoselect:1048 msgid "One expected answer" msgid_plural "%d expected answers" msgstr[0] "" msgstr[1] "" -#: hizoselect:1039 +#: hizoselect:1049 msgid "Between %s and %s expected answers" msgstr "" -#: hizoselect:1040 +#: hizoselect:1050 msgid "Minimum of %d expected answer" msgid_plural "Minimum of %d expected answers" msgstr[0] "" msgstr[1] "" -#: hizoselect:1041 +#: hizoselect:1051 msgid "Maximum of %d expected answer" msgid_plural "Maximum of %d expected answers" msgstr[0] "" msgstr[1] "" -#: hizoselect:1042 +#: hizoselect:1052 msgid "Answer" msgstr "" #. TranslationAssistance ==============================> Texts of the dynamic help -#: hizoselect:1046 +#: hizoselect:1056 msgid "Help with the use of HizoSelect" msgstr "" -#: hizoselect:1047 +#: hizoselect:1057 msgid "Number of expected answers:" msgstr "" -#: hizoselect:1048 +#: hizoselect:1058 msgid "Possible answers:" msgstr "" -#: hizoselect:1049 +#: hizoselect:1059 msgid "The numbers select their items." msgstr "" -#: hizoselect:1050 +#: hizoselect:1060 msgid "The ? select random items." msgstr "" -#: hizoselect:1051 +#: hizoselect:1061 msgid "" "The range select items starts from the first number to the second number " "included." msgstr "" -#: hizoselect:1052 +#: hizoselect:1062 msgid "The * select all items." msgstr "" -#: hizoselect:1053 +#: hizoselect:1063 msgid "Press any key for exiting the help." msgstr "" -#: hizoselect:1054 +#: hizoselect:1064 msgid "It's possible to select several times a same item." msgstr "" -#: hizoselect:1055 +#: hizoselect:1065 msgid "Each item can be only select one time." msgstr "" -#: hizoselect:1056 +#: hizoselect:1066 msgid "Information:" msgstr "" #. TranslationAssistance ==============================> Texts of the help argument -#: hizoselect:1060 +#: hizoselect:1070 msgid "Options:" msgstr "" -#: hizoselect:1061 +#: hizoselect:1071 msgid "" "Effects of actions, commentaries, errors, numbers, prompt text, secret " "texts, texts and title." msgstr "" -#: hizoselect:1062 +#: hizoselect:1072 msgid "" "Enabled actions on start. If the action is visible in the bar, the user can " "change it." msgstr "" -#: hizoselect:1063 +#: hizoselect:1073 msgid "Hides error messages." msgstr "" -#: hizoselect:1064 +#: hizoselect:1074 msgid "Pre-filled answers." msgstr "" -#: hizoselect:1065 +#: hizoselect:1075 msgid "Demonstration of commands." msgstr "" -#: hizoselect:1066 +#: hizoselect:1076 msgid "Displays this help." msgstr "" -#: hizoselect:1067 +#: hizoselect:1077 msgid "Mandatory answers." msgstr "" -#: hizoselect:1068 +#: hizoselect:1078 msgid "Format of the items." msgstr "" -#: hizoselect:1069 +#: hizoselect:1079 msgid "Maximal number of answers." msgstr "" -#: hizoselect:1070 +#: hizoselect:1080 msgid "Minimal number of answers." msgstr "" -#: hizoselect:1071 +#: hizoselect:1081 msgid "Allows to return the same answer several times." msgstr "" -#: hizoselect:1072 +#: hizoselect:1082 msgid "Enables the use of symbols in the answers." msgstr "" -#: hizoselect:1073 +#: hizoselect:1083 msgid "Displayed text between the title and the list of items." msgstr "" -#: hizoselect:1074 -msgid "Sort the proposals by value choiced." +#: hizoselect:1084 +msgid "Sort the proposals by the choiced argument." msgstr "" -#: hizoselect:1075 +#: hizoselect:1085 msgid "Format of the returned answers." msgstr "" -#: hizoselect:1076 +#: hizoselect:1086 msgid "Displayed text while waiting for the choice." msgstr "" -#: hizoselect:1077 +#: hizoselect:1087 msgid "First displayed text like a title." msgstr "" -#: hizoselect:1078 -msgid "Avoids redundant items." +#: hizoselect:1088 +msgid "Delete redundant items by the choiced argument." msgstr "" -#: hizoselect:1079 +#: hizoselect:1089 msgid "Version of the hizoselect command." msgstr "" -#: hizoselect:1080 +#: hizoselect:1090 msgid "Examples:" msgstr "" -#: hizoselect:1081 +#: hizoselect:1091 msgid "More informations:" msgstr "" -#: hizoselect:1082 +#: hizoselect:1092 msgid "item(s) " msgstr "" -#: hizoselect:1083 +#: hizoselect:1093 msgid "int " msgstr "" -#: hizoselect:1084 +#: hizoselect:1094 msgid "text " msgstr "" -#: hizoselect:1085 +#: hizoselect:1095 msgid "Management of the content of the bar and its actions." msgstr "" -#: hizoselect:1086 +#: hizoselect:1096 msgid "Disables all modes: all, range and random." msgstr "" -#: hizoselect:1087 +#: hizoselect:1097 msgid "Delimiter to use between of the returned items." msgstr "" -#: hizoselect:1088 +#: hizoselect:1098 msgid "Text to add in the help screen." msgstr "" -#: hizoselect:1089 +#: hizoselect:1099 msgid "HizoSelect command help" msgstr "" -#: hizoselect:1090 +#: hizoselect:1100 msgid "Name of the command displayed in error messages." msgstr "" -#: hizoselect:1091 +#: hizoselect:1101 msgid "Clear the terminal before display the texts." msgstr "" -#: hizoselect:1092 +#: hizoselect:1102 msgid "file" msgstr "" -#: hizoselect:1093 +#: hizoselect:1103 msgid "Load a config file who contains some values." msgstr "" #. TranslationAssistance ==============================> Texts of the examples -#: hizoselect:1097 +#: hizoselect:1107 msgid "What example(s) do you want see?" msgstr "" -#: hizoselect:1098 +#: hizoselect:1108 msgid "" "%t=Would you marry me? %c=One number by default with a limit to 1 item and " "output change" msgstr "" -#: hizoselect:1099 +#: hizoselect:1109 msgid "" "%t=Choose your menu %c=All by default with a input number for read command" msgstr "" -#: hizoselect:1100 +#: hizoselect:1110 msgid "" "%t=Write the name 'Belleguic' %c=Numbers by default with columns format and " "several mode enable" msgstr "" -#: hizoselect:1101 +#: hizoselect:1111 msgid "" "%t=What can be the age of a minor? %c=Range by default with no-all and no-" "random" msgstr "" -#: hizoselect:1102 +#: hizoselect:1112 msgid "" "%t=I remove duplicates for you %c=Uniq item option and prompt text change" msgstr "" -#: hizoselect:1103 +#: hizoselect:1113 msgid "%t=Advanced input/output argument %c=How-to use format" msgstr "" -#: hizoselect:1104 +#: hizoselect:1114 msgid "%t=Traitment of files in a for loop %c=How-to use returns with for loop" msgstr "" -#: hizoselect:1105 +#: hizoselect:1115 msgid "%t=Use multi read %c=How-to use multi while read loop" msgstr "" -#: hizoselect:1106 +#: hizoselect:1116 msgid "Command:" msgstr "" -#: hizoselect:1107 +#: hizoselect:1117 msgid "Would you marry me?" msgstr "" -#: hizoselect:1108 +#: hizoselect:1118 msgid "The number %n is %t (%c) and his secret value is %s." msgstr "" -#: hizoselect:1109 +#: hizoselect:1119 msgid "%t=Yes %c=I want it! %s=y" msgstr "" -#: hizoselect:1110 +#: hizoselect:1120 msgid "%t=No %c=Sorry... %s=n" msgstr "" -#: hizoselect:1111 +#: hizoselect:1121 msgid "I want eat a %t" msgstr "" -#: hizoselect:1112 +#: hizoselect:1122 msgid "Choose your menu (All by default):" msgstr "" -#: hizoselect:1113 +#: hizoselect:1123 msgid "%t=Entry %c=Vegetables" msgstr "" -#: hizoselect:1114 +#: hizoselect:1124 msgid "%t=Dish %c=Steak and fries" msgstr "" -#: hizoselect:1115 +#: hizoselect:1125 msgid "%t=Dessert %c=Flan" msgstr "" -#: hizoselect:1116 +#: hizoselect:1126 msgid "Write the name 'Belleguic' (Numbers by default)" msgstr "" -#: hizoselect:1117 +#: hizoselect:1127 msgid "You write:" msgstr "" -#: hizoselect:1118 +#: hizoselect:1128 msgid "What can be the age of a minor?" msgstr "" -#: hizoselect:1119 +#: hizoselect:1129 msgid "A minor may be aged: %s years" msgstr "" -#: hizoselect:1120 +#: hizoselect:1130 msgid "I remove duplicates for you:" msgstr "" -#: hizoselect:1121 +#: hizoselect:1131 msgid "You have choiced: %t" msgstr "" -#: hizoselect:1122 +#: hizoselect:1132 msgid "I wait after you:" msgstr "" -#: hizoselect:1123 +#: hizoselect:1133 msgid "Advanced input/output argument:" msgstr "" -#: hizoselect:1124 +#: hizoselect:1134 msgid "" "[%n] (mandatory) <%t and %c and %s (text and commentary and secret text)|%t " "and %c (text and commentary)|%t and %s (text and secret text)|%c and %s " "(commentary and secret text)|%t (text)|%c (commentary)|%s (secret text)>" msgstr "" -#: hizoselect:1125 +#: hizoselect:1135 msgid "" "\\<%n\\> (always exists) \\| <%t and %c and %s (text and commentary and " "secret text)|%t and %c (text and commentary)|%t and %s (text and secret " @@ -476,96 +476,96 @@ "(secret text)>" msgstr "" -#: hizoselect:1126 +#: hizoselect:1136 msgid "Select the files to update" msgstr "" -#: hizoselect:1127 +#: hizoselect:1137 msgid "I choosen %s." msgstr "" -#: hizoselect:1128 +#: hizoselect:1138 msgid "%t=Select software to install %c=Use the secret text" msgstr "" -#: hizoselect:1129 +#: hizoselect:1139 msgid "%t=Select women as you know %c=Create an array indexed" msgstr "" -#: hizoselect:1130 +#: hizoselect:1140 msgid "Select software to install" msgstr "" -#: hizoselect:1131 +#: hizoselect:1141 msgid "Select women as you know" msgstr "" #. TranslationAssistance ==============================> h letter for help -#: hizoselect:1135 +#: hizoselect:1145 msgid "h" msgstr "" -#: hizoselect:1136 +#: hizoselect:1146 msgid "Help" msgstr "" #. TranslationAssistance ==============================> c letter for effects -#: hizoselect:1138 +#: hizoselect:1148 msgid "c" msgstr "" -#: hizoselect:1139 +#: hizoselect:1149 msgid "Enable effects" msgstr "" -#: hizoselect:1140 +#: hizoselect:1150 msgid "Disable effects" msgstr "" #. TranslationAssistance ==============================> v letter for view -#: hizoselect:1142 +#: hizoselect:1152 msgid "v" msgstr "" -#: hizoselect:1143 +#: hizoselect:1153 msgid "View in columns" msgstr "" -#: hizoselect:1144 +#: hizoselect:1154 msgid "View in lines" msgstr "" #. TranslationAssistance ==============================> d letter for debug -#: hizoselect:1146 +#: hizoselect:1156 msgid "d" msgstr "" -#: hizoselect:1147 +#: hizoselect:1157 msgid "Enable debug" msgstr "" -#: hizoselect:1148 +#: hizoselect:1158 msgid "Disable debug" msgstr "" #. TranslationAssistance ==============================> l letter for lang -#: hizoselect:1150 +#: hizoselect:1160 msgid "l" msgstr "" -#: hizoselect:1151 +#: hizoselect:1161 msgid "French translation" msgstr "" -#: hizoselect:1152 +#: hizoselect:1162 msgid "English translation" msgstr "" #. TranslationAssistance ==============================> e letter for exit -#: hizoselect:1154 +#: hizoselect:1164 msgid "e" msgstr "" -#: hizoselect:1155 +#: hizoselect:1165 msgid "Exit" msgstr "" Binary files /tmp/tmpf50aw7dg/v41mYAEYAy/hizoselect-3.1.5/fr/LC_MESSAGES/hizoselect.mo and /tmp/tmpf50aw7dg/NvyUTIQgcB/hizoselect-3.1.7/fr/LC_MESSAGES/hizoselect.mo differ diff -Nru hizoselect-3.1.5/hizoselect hizoselect-3.1.7/hizoselect --- hizoselect-3.1.5/hizoselect 2021-07-10 09:49:14.000000000 +0000 +++ hizoselect-3.1.7/hizoselect 2021-08-22 16:26:12.000000000 +0000 @@ -1,5 +1,6 @@ #!/bin/bash + # nettoyage des sauts de lignes et tabulations et carac null dans les propositions # => ne faut il pas les laisser afin de les récupérer à la sortie ? @@ -61,12 +62,13 @@ ## Variables globales ## ######################## ### version et licence -Version="3.1.5 - 10/07/2021" +Version="3.1.7 - 22/08/2021" Licence="GNU GPL v3" ### Variables par défaut, à charger malgré le fichier default.cfg afin de ne pas manquer une variable All=1 +BarLetters="hcvdle" Bar="hcvdle" Columns=0 ColumnExists=0 @@ -83,7 +85,7 @@ Random=1 Range=1 Uniq=1 -UniqueItem=0 +UniqueItem= SortType= ClearTerminal=0 LettresOK="a-mo-zA-Z" # Bloque seulement %n @@ -125,7 +127,7 @@ Random=1 # Enable ? answer Range=1 # Enable x-y answer Uniq=1 # Enable uniq answer -UniqueItem=0 # Disable uniq proposal +UniqueItem= # Disable uniq proposal SortType= # Disable answer sort ClearTerminal=0 # Disable cleaning terminal before display texts @@ -381,7 +383,7 @@ done # Cas spécifique à --answers et au mode unique - # Remplacement du de ${answers} par ${TempList} qui ne contient pas de doublons avec --force + # Remplacement de ${answers} par ${TempList} qui ne contient pas de doublons avec --force (( ${Uniq} )) && [[ ${1} == "answers" && ${ForceAnswers[*]} ]] && Answers=("${TempList[@]}") # Récupération de la liste des réponses @@ -584,6 +586,9 @@ Answer="${Answer/#*(0)/}" Answer="${Answer//&&&&&Hizo&&&&&/|}" + # Si utilisation de *, on les veut tous + [[ ${Answer} == '*' ]] && Answer= + # Mode numérique, Il peut y avoir plusieurs nombres avec ou non une plage, séparés par des , ou ; ou des espaces if [[ ${Answer} =~ ^([\-0-9\ ,\;?]+)$ ]] then @@ -1071,11 +1076,11 @@ "arg_help12") gettext "Allows to return the same answer several times." ;; "arg_help13") gettext "Enables the use of symbols in the answers." ;; "arg_help14") gettext "Displayed text between the title and the list of items." ;; - "arg_help15") gettext "Sort the proposals by value choiced." ;; + "arg_help15") gettext "Sort the proposals by the choiced argument." ;; "arg_help16") gettext "Format of the returned answers." ;; "arg_help17") gettext "Displayed text while waiting for the choice." ;; "arg_help18") gettext "First displayed text like a title." ;; - "arg_help19") gettext "Avoids redundant items." ;; + "arg_help19") gettext "Delete redundant items by the choiced argument." ;; "arg_help20") gettext "Version of the hizoselect command." ;; "arg_help21") gettext "Examples:" ;; "arg_help22") gettext "More informations:" ;; @@ -1206,6 +1211,118 @@ # Valeur spéciale permettant d'indiquer que les arguments sont terminées "--") StopArg=1 ;; + + # Arguments nécessitants une valeur + "-a"|"--answers"|"-d"|"--default"|"-D"|"--delimiter"|"-e"|"--effects"|"-f"|"--force"|"-i"|"--input"|"-I"|"--info"|"-m"|"--min"|"-M"|"--max"|"-n"|"--name"|"-o"|"--output"|"-p"|"--prompt"|"-P"|"--proposals"|"-t"|"--text"|"-T"|"--title") + # Message d'erreur si aucune valeur + [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" + + # Spécificité du nom de la variable + case "${Value}" in + # Réponses par défaut + "-d"|"--default"|"-a"|"--answers") AnswersTemp="${2}" ;; + + # Délimiteur à utiliser + "-D"|"--delimiter") Delimiter="${2}" ;; + + # Effets de texte + "-e"|"--effects") + mapfile -t -d '%' Lettres < <(printf "%s" "${2}") + + # Boucle sur les différents noms de couleur + for Effects in "${Lettres[@]}" + do + # Lettre utilisée et liste des effets + Letter=${Effects:0:1} + EffectsList="${Effects:2}" + + # Si la valeur n'est pas bonne + [[ ${Letter} != [a-zA-Z] ]] && continue + + # Si c'est un mot clé + if [[ ${Effects^} =~ ^(${EffectsKey})=(.*) ]] + then + Letter="${BASH_REMATCH[1]^}" + EffectsList="${BASH_REMATCH[2],,}" + fi + + # Mise à jour de la liste des couleurs + DefineEffects[${Letter}]="${EffectsList}" + done ;; + + # Réponses forcées + "-f"|"--force") + # Transformation de , ; + en espace + # mapfile -t -d ' ' ForceAnswers < <(printf "%s" "${2//[,;+]/ }") + ForceAnswersTemp="${2}" ;; + + # Format de l'affichage des propositions + "-i"|"--input") InputText="${2}" ;; + + # Information à afficher dans l'aide + "-I"|"--info") Info="${2}" ;; + + # Nombre de réponse minimum + "-m"|"--min") Min="${2}" ;; + + # Nombre de réponse maximum + "-M"|"--max") Max="${2}" ;; + + # Nom de la commande en cas d'erreur + "-n"|"--name") Name="${2}" ;; + + # Format du texte de sortie + "-o"|"--output") OutputText="${2}" ;; + + # Texte du prompt + "-p"|"--prompt") + PromptText="${2}" + + # Ajout d'un espace si la dernière valeur du texte est un nombre car ça va gêner le read + [[ ${PromptText: -1} == [0-9] ]] && PromptText+=" " ;; + + # Origine des propositions + "-P"|"--proposals") ProposalsOrigin="${2}" ;; + + # Texte suivant le titre + "-t"|"--text") Text="${2}" ;; + + # Texte du titre + "-T"|"--title") Title="${2}" ;; + esac + + shift ;; + + + # Arguments nécessitants des valeurs de type %x valides + "--sort"|"-u"|"--uniq-item") + # Vérification de l'argument + [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" + + # Vérification de la validité des arguments + mapfile -t -d '%' Lettres < <(printf "%s" "${2}") + for Lettre in "${Lettres[@]}" + do + [[ ${Lettre} && "${Lettre// }" != [a-zA-Z] ]] && ExitErreur "error_arg_value@${1}@${2}" + done + + # Spécificité du nom de la variable + case "${Value}" in + # Rangement des propositions + "--sort") SortType="${2}" ;; + + # Mode proposition unique + "-u"|"--uniq-item") + # Le résultat ne peut être que composé de %x + Temp="${2// }" + (( ${#Temp} != 2 )) && ExitErreur "error_arg_value@${1}@${2}" + + UniqueItem="${Temp}" ;; + esac + + shift ;; + + # Actions activées au démarrage "-A"|"--actions") Columns=0 @@ -1224,7 +1341,21 @@ # Gestion de la barre "-b"|"--bar") Bar="" - [[ ${ArgOrVal} == "Valeur" ]] && Bar="${2// }" ;; + + if [[ ${ArgOrVal} == "Valeur" ]] + then + Temp="${2// }" + + # Vérifie que les lettres sont valables + for ((x=0; x<${#Temp}; x++ )) + do + [[ "${BarLetters}" != *${Temp:${x}:1}* ]] && ExitErreur "error_arg_value@${1}@${Temp:${x}:1}" + done + + unset Temp + + Bar="${2// }" + fi ;; # Configuration à utiliser "-c"|"--config") @@ -1264,53 +1395,6 @@ # Gestion de la barre "-C"|"--clear") ClearTerminal=1 ;; - # Réponses par défaut - "-d"|"--default"|"-a"|"--answers") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - - # Ne fait que conserver la variable qui sera traitée plus tard - AnswersTemp="${2}" - - shift ;; - - # Délimiteur à utiliser - "-D"|"--delimiter") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Delimiter="${2}" - shift ;; - - # Effets de texte - "-e"|"--effects") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - - if [[ ${2} ]] - then - mapfile -t -d '%' Lettres < <(printf "%s" "${2}") - - # Boucle sur les différents noms de couleur - for Effects in "${Lettres[@]}" - do - # Lettre utilisée et liste des effets - Letter=${Effects:0:1} - EffectsList="${Effects:2}" - - # Si la valeur n'est pas bonne - [[ ${Letter} != [a-zA-Z] ]] && continue - - # Si c'est un mot clé - if [[ ${Effects^} =~ ^(${EffectsKey})=(.*) ]] - then - Letter="${BASH_REMATCH[1]^}" - EffectsList="${BASH_REMATCH[2],,}" - fi - - # Mise à jour de la liste des couleurs - DefineEffects[${Letter}]="${EffectsList}" - done - fi - - shift ;; - # Exemples "-E"|"--ex"|"--eg"|"--examples") # Chargement des effets visuels @@ -1401,16 +1485,6 @@ exit 0 ;; - # Réponse forcées - "-f"|"--force") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - - # Transformation de , ; + en espace -# mapfile -t -d ' ' ForceAnswers < <(printf "%s" "${2//[,;+]/ }") - ForceAnswersTemp="${2}" - - shift ;; - # Affichage de l'aide "-h"|"-?"|"--help") # Chargement des effets visuels @@ -1445,7 +1519,7 @@ ${Start}--sort${Effects["t"]} %[a-Z]${Unset}\t\t\t\t\t$(LangText "arg_help15") ${Start}-t, --text${Effects["t"]} $(LangText "arg_help25")${Unset}\t\t\t\t$(LangText "arg_help14") ${Start}-T, --title${Effects["t"]} $(LangText "arg_help25")${Unset}\t\t\t\t$(LangText "arg_help18") -${Start}-u, --uniq-item${Unset}\t\t\t\t\t$(LangText "arg_help19") +${Start}-u, --uniq-item${Unset}${Effects["t"]} %[a-Z]${Unset}\t\t\t\t$(LangText "arg_help19") ${Start}-v, --version${Unset}\t\t\t\t\t$(LangText "arg_help20") ${Effects["n"]}$(LangText "arg_help21")${Unset} @@ -1456,65 +1530,6 @@ exit 0 ;; - # Format de l'affichage des propositions - "-i"|"--input") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - InputText="${2}" - - shift ;; - - # Information à afficher dans l'aide - "-I"|"--info") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Info="${2}" - - shift ;; - - # Nombre de réponse minimum - "-m"|"--min") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Min="${2}" - - shift ;; - - # Nombre de réponse maximum - "-M"|"--max") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Max="${2}" - - shift ;; - - # Nombre de réponse maximum - "-n"|"--name") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Name="${2}" - - shift ;; - - # Format du texte de sortie - "-o"|"--output") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - OutputText="${2}" - - shift ;; - - # Texte du prompt - "-p"|"--prompt") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - PromptText="${2}" - - # Ajout d'un espace si la dernière valeur du texte est un nombre car ça va gêner le read - [[ ${PromptText: -1} == [0-9] ]] && PromptText+=" " - - shift ;; - - # Origine des propositions - "-P"|"--proposals") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - ProposalsOrigin="${2}" - - shift ;; - # Mode réponse non unique "-s"|"--several"|"--multi") Uniq=0 ;; @@ -1533,39 +1548,6 @@ shift fi ;; - # Rangement des propositions - "--sort") - # Vérification de l'argument - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - - # Vérification de la validité des arguments - mapfile -t -d '%' Lettres < <(printf "%s" "${2}") - for Lettre in "${Lettres[@]}" - do - [[ ${Lettre} && "${Lettre// }" != [a-zA-Z] ]] && ExitErreur "error_arg_value@${1}@${2}" - done - - SortType="${2}" - - shift ;; - - # Texte suivant le titre - "-t"|"--text") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Text="${2}" - - shift ;; - - # Texte du titre - "-T"|"--title") - [[ ${ArgOrVal} != "Valeur" ]] && ExitErreur "argument@${1}" - Title="${2}" - - shift ;; - - # Mode proposition unique - "-u"|"--uniq-item") UniqueItem=1 ;; - # Version du logiciel "-v"|"--version") echo -e "HizoScript version ${Version}.\n${Licence}." >&2 @@ -1582,31 +1564,23 @@ # nettoyage des caractères spéciaux #ProposalTemp="${1//$'\n'/ }" ProposalTemp="${ProposalTemp//$'\t'/ }" ProposalTemp="${ProposalTemp//$'\0'/}" - if (( ${#1} && ${UniqueItem} )) - then - # N'ajoute la valeur que si elle n'existe pas - InArray "${1}" "${Proposals[*]}" || Proposals+=("${1}") + # Ajoute %t si besoin + ProposalTemp="${1}" + [[ ${ProposalTemp:0:1} != "%" ]] && ProposalTemp="%t=${ProposalTemp}" - else - # Ajoute la valeur quelque soit le cas - Proposals+=("${1}") - fi + # Ajoute la valeur quelque soit le cas + Proposals+=("${ProposalTemp}") fi ;; esac # Si on est ici, c'est qu'on a utilisé --, du coup, tout ce qui suit sert de proposition else - # Si la variable est vide, on ne la prend pas - if (( ${#1} && ${UniqueItem} )) - then - # N'ajoute la valeur que si elle n'existe pas - InArray "${1}" "${Proposals[*]}" || Proposals+=("${1}") + # Ajoute %t si besoin + ProposalTemp="${1}" + [[ ${ProposalTemp:0:1} != "%" ]] && ProposalTemp="%t=${ProposalTemp}" - elif [[ ${1} ]] - then - # Ajoute la valeur quelque soit le cas - Proposals+=("${1}") - fi + # Ajoute la valeur quelque soit le cas + Proposals+=("${ProposalTemp}") fi # On décale les arguments ${1} est détruit, ${2} devient ${1}, ${3} devient ${2}... @@ -1614,29 +1588,111 @@ done -### Ajout de stdin à la liste des propositions s'il y a quelque chose à ajouter + +###################### +## Gestion de stdin ## +###################### +# Lecture uniquement de stdin if [[ ${ProposalsOrigin} -eq 1 ]] && test ! -t 0 then stdin="$( Il faut supprimer les \% + mapfile -t -d '%' Arguments < <(printf "%s" "${Answer}") + + # Traite chaque argument de la proposition + for Argument in "${Arguments[@]}" + do + Argument="${Argument/%+([[:space:]])}" + + # Saute les arguments vides + [[ -z ${Argument} ]] && continue + + # Saute les arguments non concernés + [[ "${UniqueItem}" != "%${Argument:0:1}" ]] && continue + + if ! InArray "${Argument}" "${AntiDoublon[*]}" + then + NewAnswers+=("${Answer}") + AntiDoublon+=("${Argument}") + break + fi + done + done + + # Nouvelle liste de proposition rangée si différentes et non vide + [[ "${Proposals[*]}" != "${NewAnswers[*]}" ]] && readarray -t Proposals < <(printf "\n%s" "${NewAnswers[@]}") + + # Nettoyage + unset AntiDoublon NewAnswers +fi + + +################################ +## Rangement des propositions ## +################################ if [[ ${SortType} ]] then # Liste de sortie @@ -1683,22 +1739,24 @@ done # Nouvelle liste de proposition rangée si différentes - [[ "${Proposals[*]}" != "${NewAnswers[*]}" ]] && readarray -t Proposals < <(for a in "${NewAnswers[@]}"; do echo "$a"; done | sort) + [[ "${Proposals[*]}" != "${NewAnswers[*]}" ]] && readarray -t Proposals < <(printf "\n%s" "${NewAnswers[@]}" | sort) # Nettoyage unset TempAnswer NewAnswer NewAnswers Answer fi -### Suppression de la valeur 0 maintenant que la liste est remplie +############ +## Divers ## +############ +# Suppression de la valeur 0 maintenant que la liste est remplie unset Proposals["0"] -### Chargement des effets visuels +# Chargement des effets visuels EffectsSetUp ${Effect} - -### Si max n'est pas défini, qu'on ne peut dupliquer les réponses et que --min est < au nombre de proposition +# Si max n'est pas défini, qu'on ne peut dupliquer les réponses et que --min est < au nombre de proposition (( ! ${Max} && ${Uniq} && ${Min} < ${#Proposals[@]} )) && Max="${#Proposals[@]}" diff -Nru hizoselect-3.1.5/man/hizoselect.1 hizoselect-3.1.7/man/hizoselect.1 --- hizoselect-3.1.5/man/hizoselect.1 2021-07-10 09:49:30.000000000 +0000 +++ hizoselect-3.1.7/man/hizoselect.1 2021-08-22 16:18:41.000000000 +0000 @@ -1,4 +1,4 @@ -.TH HIZOSELECT 1 "5 Jun 2021" "Version 3.1.5" "Manpage of the HizoSelect command" +.TH HIZOSELECT 1 "5 Jun 2021" "Version 3.1.6" "Manpage of the HizoSelect command" .SH NAME @@ -51,7 +51,7 @@ .br [\fB-T\fP|\fB--title\fP \fItexte\fP] .br -[\fB-u\fP|\fB--uniq-item\fP] +[\fB-u\fP|\fB--uniq-item\fP \fI%[a-Z]\fP] .br proposals .br @@ -402,9 +402,9 @@ .RE .RE -.IP \fB-u,\ --uniq-item\fP +.IP \fB-u,\ --uniq-item\fP\ \fI%[a-Z]\fP .br -Deletes any redundant item (\fIfalse\fP by default). +Removes duplicate answer suggestions based on the indicated argument (\fIempty\fP by default). .IP \fB-v,\ --version\fP .br diff -Nru hizoselect-3.1.5/man/hizoselect.fr.1 hizoselect-3.1.7/man/hizoselect.fr.1 --- hizoselect-3.1.5/man/hizoselect.fr.1 2021-07-10 09:49:27.000000000 +0000 +++ hizoselect-3.1.7/man/hizoselect.fr.1 2021-08-22 16:17:54.000000000 +0000 @@ -1,4 +1,4 @@ -.TH HIZOSELECT 1 "5 Juin 2021" "Version 3.1.5" "Manuel de la commande HizoSelect" +.TH HIZOSELECT 1 "5 Juin 2021" "Version 3.1.6" "Manuel de la commande HizoSelect" .SH NOM @@ -51,7 +51,7 @@ .br [\fB-T\fP|\fB--title\fP \fItexte\fP] .br -[\fB-u\fP|\fB--uniq-item\fP] +[\fB-u\fP|\fB--uniq-item\fP \fI%[a-Z]\fP] .br propositions .br @@ -391,9 +391,9 @@ .RE .RE -.IP \fB-u,\ --uniq-item\fP +.IP \fB-u,\ --uniq-item\fP\ \fI%[a-Z]\fP .br -Supprime les propositions de réponse en double (\fIfaux\fP par défaut). +Supprime les propositions de réponse en double en se basant sur l'argument indiqué (\fIvide\fP par défaut). .IP \fB-v,\ --version\fP .br