From e663c2eb6fe31a7426c906cbf3397ac8105ebfba Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 30 May 2023 15:53:11 +0200 Subject: [PATCH 001/103] typo in italian translation --- .../02_stdin_redirection_multiplications/i18n/it.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po index 13cbf6e69..f51880c47 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po @@ -19,7 +19,7 @@ msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/it.txt" msgid "Greek_Latin_and_other_modern_languages" -msgstr "Grego_Latino_e_altre_lingue_moderne" +msgstr "Greco_Latino_e_altre_lingue_moderne" msgid "How_to_cheat_for_exams" msgstr "Come_imbrogliare_negli_esami" From 9c855755d6b8d084e9864672cbf8bc64c8db2156 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 7 Jun 2023 11:06:58 +0200 Subject: [PATCH 002/103] remove warning about GameShell being under "heavy development" --- README-fr.md | 5 ----- README-it.md | 2 -- README.md | 5 ----- 3 files changed, 12 deletions(-) diff --git a/README-fr.md b/README-fr.md index 9667e1062..142017621 100644 --- a/README-fr.md +++ b/README-fr.md @@ -27,11 +27,6 @@ pourriez créer ! Comment jouer ? --------------- -**Note:** GameShell est en phase de développement : la version courante n'a -pas été intensivement testée par des étudiants. N'hésitez pas à rapporter tout -problème que vous pourriez rencontrer et toute suggestion d'amélioration en -ouvrant une ["issue"](https://github.com/phyver/GameShell/issues/new). - GameShell devrait fonctionner sur n'importe quel système Linux standard, et aussi sur macOS et BSD (mais ces systèmes ont été moins testés). Sur Debian ou Ubuntu, les seules dépendances (autres que `bash`) sont les paquets `awk` et diff --git a/README-it.md b/README-it.md index c500a3d59..892d0544c 100644 --- a/README-it.md +++ b/README-it.md @@ -18,8 +18,6 @@ Siamo molto interessati nella creazione di nuove missioni! Come cominciare --------------- -**Nota:** GameShell è attualmente sotto uno sviluppo pesante: la versione corrente non é stata testata dagli studenti. Non esitare a segnalare qualunque problema o suggerimento [aprendo un ticket](https://github.com/phyver/GameShell/issues/new). - GameShell dovrebbe funzionare in qualunque sistema Linux standard, e anche su macOS e BSD (ma abbiamo eseguito pochi test su questi). Su Debian e Ubuntu, le uniche dipendenze (oltre `bash`) sono i pacchetti `gettext-base` e `awk`(questo di solito presente di default). Alcune missioni hanno dipendenze addizionali: queste missioni verranno saltate se le dipendenze non sono state risolte. Su Debian o Ubuntu, esegui i comandi seguenti per installare tutte le dipendenze del gioco e delle missioni. ```sh diff --git a/README.md b/README.md index 6e530aa08..ae2504dcc 100644 --- a/README.md +++ b/README.md @@ -30,11 +30,6 @@ We are particularly interested in any new missions you might create! Getting started --------------- -**Note:** GameShell is currently undergoing heavy development: the current -version has not been field tested by students. Do not hesitate to report any -problems you might encounter or suggestions you might have by -[opening an issue](https://github.com/phyver/GameShell/issues/new). - GameShell should work on any standard Linux system, and also on macOS and BSD (but we have run fewer tests on the latter systems). On Debian or Ubuntu, the only dependencies (besides `bash`) are the `gettext-base` and `awk` packages From cfa53c41c49a943023378cd8c920cc06f0b1c42e Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 13 Jun 2023 21:21:24 +0200 Subject: [PATCH 003/103] bug when changing the admin password in the last mission this mission wasn't updated when the salt was introduced in commit 449b379c45bd2556283d02bf3601d05e6c8f951b --- missions/FINAL_MISSION/goal.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/missions/FINAL_MISSION/goal.sh b/missions/FINAL_MISSION/goal.sh index ec865d186..fefdfc588 100644 --- a/missions/FINAL_MISSION/goal.sh +++ b/missions/FINAL_MISSION/goal.sh @@ -1,7 +1,12 @@ #!/usr/bin/env sh -export password=$(gettext "qwerty") -checksum "$password" > "$GSH_CONFIG/admin_hash" -sed "s/\\\$password/$password/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" -unset password +ADMIN_PASSWD=$(gettext "qwerty") +ADMIN_SALT=$("$GSH_ROOT"/scripts/random_string) +ADMIN_HASH=$(checksum "$ADMIN_SALT $ADMIN_PASSWD") + +echo "$ADMIN_SALT" > "$GSH_CONFIG/admin_salt" +echo "$ADMIN_HASH" > "$GSH_CONFIG/admin_hash" + +sed "s/\\\$password/$ADMIN_PASSWD/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" +unset ADMIN_PASSWD ADMIN_SALT ADMIN_HASH From 4496ca3c44b1ab2e0673e1f3141113e45a6ad8b9 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 14 Jun 2023 11:55:36 +0200 Subject: [PATCH 004/103] simpler cleaning for stall missions removing all the files in the stall is not always possible with ``rm Stall/*`` (=> too many arguments) and takes a long time anyway. I used to remove the directory with ``rm -rf Stall`` and recreate it, but this caused problems when the user was in the Stall and used a subshell for running ``gsh check`` (usually as a way to get one extra command). So, I now use ``find Stall -type f -delete``. This is not POSIX but seems to work on Linux, MacOS and the BSD I've tried. --- .../pipes_merchant_stall/00_shared/clean.sh | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/missions/pipes_merchant_stall/00_shared/clean.sh b/missions/pipes_merchant_stall/00_shared/clean.sh index 83d841673..37a193f4e 100644 --- a/missions/pipes_merchant_stall/00_shared/clean.sh +++ b/missions/pipes_merchant_stall/00_shared/clean.sh @@ -2,19 +2,14 @@ # need to be careful, as there are so many files in the Stall that # rm Stall/* may not work. -case "$(pwd -P)" in - "$(eval_gettext '$GSH_HOME/Stall')"*) - cd "$GSH_HOME" - rm -rf "$(eval_gettext '$GSH_HOME/Stall')" - mkdir -p "$(eval_gettext '$GSH_HOME/Stall')" - cd "$(eval_gettext '$GSH_HOME/Stall')" - ;; - *) - rm -rf "$(eval_gettext '$GSH_HOME/Stall')" - mkdir -p "$(eval_gettext '$GSH_HOME/Stall')" - ;; -esac +# find ... -exec rm "{}" -; is too slow +# so I use find ... -delete +# this is not POSIX but looks supported on Linux, OpenBSD, FreeBSD and MacOS +# (The POSIX alternative is to remove the Stall directory itself with rm -rf, +# and recreate it. But this can cause problems if the user is in the stall and uses a subshell for +# gsh check or gsh reset.) +find "$(eval_gettext '$GSH_HOME/Stall')" -type f -delete rm -f "$GSH_TMP/nb_commands" "$GSH_TMP/last_command" PS1=$_PS1 From c4d0a88a27b991f94772f5ac3fcbd863f4e91add Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 14 Jun 2023 15:08:51 +0200 Subject: [PATCH 005/103] process names for 03_pstree_kill were wrong the shebang for the corresponding shellscripts ended up being #!/usr/bin/env sh which made the process name (with ps) end up being "sh" rather than the filename of the script. I now explicitly (re) set the shebang when copying the scripts to make sure to use the appropriate shell. (That should work, even on NixOS, which was the main reason for using "/usr/bin/env sh" shebang). --- missions/processes/00_shared/init.sh | 12 ++++++++++-- missions/processes/00_shared/static.sh | 1 - missions/processes/00_shared/test-proc-name.sh | 2 +- missions/processes/03_pstree_kill/init.sh | 16 ++++++++++++---- .../processes/03_pstree_kill/mischievous_imp.sh | 2 +- missions/processes/03_pstree_kill/nice_fairy.sh | 2 +- 6 files changed, 25 insertions(+), 10 deletions(-) diff --git a/missions/processes/00_shared/init.sh b/missions/processes/00_shared/init.sh index b43c4acf2..bfe081a2f 100644 --- a/missions/processes/00_shared/init.sh +++ b/missions/processes/00_shared/init.sh @@ -3,12 +3,20 @@ # use a subshell, that should guarantee that no message is displayed when the # test-proc-name process is killed. _mission_init() ( - cp "$MISSION_DIR/test-proc-name.sh" "$GSH_TMP/test-proc-name" + + # make sure the shebang for the test-proc-name.sh script is a real path to sh + # otherwise, ps will not use the filename as the process name... + sh=$(command -v sh) + + # no need for copy_bin + echo "#! $sh" > "$GSH_TMP/test-proc-name" + cat "$MISSION_DIR/test-proc-name.sh" >> "$GSH_TMP/test-proc-name" chmod +x "$GSH_TMP/test-proc-name" + "$GSH_TMP/test-proc-name" & PID=$! name=$(my_ps $PID | grep $PID | grep -v sh | grep "test-proc-name") - kill -9 $PID + # kill -9 $PID if [ -z "$name" ] then echo "$(eval_gettext "Process names should be equal to the corresponding filename for mission \$MISSION_NAME.")" >&2 diff --git a/missions/processes/00_shared/static.sh b/missions/processes/00_shared/static.sh index e566e08ea..e0c58fc64 100644 --- a/missions/processes/00_shared/static.sh +++ b/missions/processes/00_shared/static.sh @@ -13,4 +13,3 @@ else # with additional options ps -ceo pid,ppid,comm copy_bin "$MISSION_DIR/my_ps-macos" "$GSH_ROOT/.sbin/my_ps" fi - diff --git a/missions/processes/00_shared/test-proc-name.sh b/missions/processes/00_shared/test-proc-name.sh index d501e2c2f..dd7339aec 100644 --- a/missions/processes/00_shared/test-proc-name.sh +++ b/missions/processes/00_shared/test-proc-name.sh @@ -1,2 +1,2 @@ -#!/usr/bin/env sh +#!/bin/sh sleep 100 diff --git a/missions/processes/03_pstree_kill/init.sh b/missions/processes/03_pstree_kill/init.sh index e5b48fc05..bcbbb13a5 100644 --- a/missions/processes/03_pstree_kill/init.sh +++ b/missions/processes/03_pstree_kill/init.sh @@ -75,18 +75,26 @@ _install_script() ( fi mission_source "$MISSION_DIR/deps.sh" || return 1 - cp "$MISSION_DIR/nice_fairy.sh" "$GSH_TMP/$(gettext "nice_fairy")" + # we need to make sure the shebang is an actual path the a shell, otherwise + # the process name will not be the filename + sh=$(command -v sh) + + echo "#! $sh" > "$GSH_TMP/$(gettext "nice_fairy")" + cat "$MISSION_DIR/nice_fairy.sh" >> "$GSH_TMP/$(gettext "nice_fairy")" chmod 755 "$GSH_TMP/$(gettext "nice_fairy")" mkdir -p "$GSH_TMP/fairy/" - cp "$MISSION_DIR/fairy/spell.sh" "$GSH_TMP/fairy/$(gettext "spell")" + echo "#! $sh" > "$GSH_TMP/fairy/$(gettext "spell")" + cat "$MISSION_DIR/fairy/spell.sh" >> "$GSH_TMP/fairy/$(gettext "spell")" chmod 755 "$GSH_TMP/fairy/$(gettext "spell")" - cp "$MISSION_DIR/mischievous_imp.sh" "$GSH_TMP/$(gettext "mischievous_imp")" + echo "#! $sh" > "$GSH_TMP/$(gettext "mischievous_imp")" + cat "$MISSION_DIR/mischievous_imp.sh" >> "$GSH_TMP/$(gettext "mischievous_imp")" chmod 755 "$GSH_TMP/$(gettext "mischievous_imp")" mkdir -p "$GSH_TMP/imp/" - cp "$MISSION_DIR/imp/spell.sh" "$GSH_TMP/imp/$(gettext "spell")" + echo "#! $sh" > "$GSH_TMP/imp/$(gettext "spell")" + cat "$MISSION_DIR/imp/spell.sh" >> "$GSH_TMP/imp/$(gettext "spell")" chmod 755 "$GSH_TMP/imp/$(gettext "spell")" ) diff --git a/missions/processes/03_pstree_kill/mischievous_imp.sh b/missions/processes/03_pstree_kill/mischievous_imp.sh index 132387f92..4d90a71e7 100755 --- a/missions/processes/03_pstree_kill/mischievous_imp.sh +++ b/missions/processes/03_pstree_kill/mischievous_imp.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh . gsh_gettext.sh diff --git a/missions/processes/03_pstree_kill/nice_fairy.sh b/missions/processes/03_pstree_kill/nice_fairy.sh index ecad8e785..eca2e94b4 100755 --- a/missions/processes/03_pstree_kill/nice_fairy.sh +++ b/missions/processes/03_pstree_kill/nice_fairy.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh . gsh_gettext.sh From cb3bd4ad15004efd9d60ba422addfdd3b0b153c6 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 14 Jun 2023 15:16:28 +0200 Subject: [PATCH 006/103] missing quotes in archive.sh --- utils/archive.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/utils/archive.sh b/utils/archive.sh index 91ea84799..61597f977 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -1,7 +1,7 @@ #!/usr/bin/env sh export GSH_ROOT=$(dirname "$0")/.. -. $GSH_ROOT/lib/profile.sh +. "$GSH_ROOT"/lib/profile.sh display_help() { cat < Date: Thu, 23 Nov 2023 23:18:57 +0100 Subject: [PATCH 007/103] FICHIER -> FILE in English goal file for mission 05_stdout_stderr_redirection_merlin --- .../05_stdout_stderr_redirection_merlin/goal/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/en.txt b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/en.txt index ad9bb8634..4f54693d0 100644 --- a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/en.txt +++ b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/en.txt @@ -26,7 +26,7 @@ COMMAND > FILE Send standard output (stdout) for the command to a file. (The file is overwritten.) -COMMAND 2> FICHIER +COMMAND 2> FILE Send error output (stderr) for the command to a file. (The file is overwritten.) From b8290a77b51609d5051754717b67106a517119d6 Mon Sep 17 00:00:00 2001 From: CocoEC <94222859+CocoEC@users.noreply.github.com> Date: Thu, 30 Nov 2023 20:02:28 +0100 Subject: [PATCH 008/103] fix: typo in README-fr.md (#139) Co-authored-by: Clement Escude--Cotinat --- README-fr.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README-fr.md b/README-fr.md index 142017621..4a2983480 100644 --- a/README-fr.md +++ b/README-fr.md @@ -124,7 +124,7 @@ GameShell est distribué sous la licence [GPLv3](https://www.gnu.org/licenses/gp Merci de pointer vers ce dépôt si vous l'utilisez. GameShell est open source et son utilisation est gratuite. Une manière de -reconnaitre le travail que cela à nécessité est d'envoyer un carte postale à +reconnaitre le travail que cela a nécessité est d'envoyer une carte postale à ``` Pierre Hyvernat From 5c0c87586bd4d6f4a98cf1788ab1a264e815bd6e Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 9 Feb 2024 10:33:25 +0100 Subject: [PATCH 009/103] wrong name for coin file in check message --- missions/finding_files_maze/03_find_1/check.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/missions/finding_files_maze/03_find_1/check.sh b/missions/finding_files_maze/03_find_1/check.sh index 0fcd3f114..b04b0e16a 100644 --- a/missions/finding_files_maze/03_find_1/check.sh +++ b/missions/finding_files_maze/03_find_1/check.sh @@ -12,6 +12,7 @@ _mission_check_p() ( fi if ! cmp -s "$coin" "$GSH_TMP/${coin_name}_$COIN_NB" then + coin_name=$(basename "$coin") echo "$(eval_gettext "Coin '\$coin_name' in your chest is invalid!")" return 1 fi From 000a07bbe5905ccd90a09904c1db30c69b64b703 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 9 Feb 2024 11:03:33 +0100 Subject: [PATCH 010/103] do not remove $GSH_CHEST/journal.txt when cleaning mission 16 --- missions/intermediate/02_alias_journal/check.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/missions/intermediate/02_alias_journal/check.sh b/missions/intermediate/02_alias_journal/check.sh index 53b966926..96e32da38 100644 --- a/missions/intermediate/02_alias_journal/check.sh +++ b/missions/intermediate/02_alias_journal/check.sh @@ -30,14 +30,20 @@ _mission_check() { target_path="${cmd// *$EDITOR */}" echo "$(eval_gettext "It seems you alias doesn't refer to the appropriate file (\$target_path). Make sure to use an absolute path...")" + # save real journal.txt from the chest find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf + [ -f "$GSH_CHEST/journal.txt" ] && cp "$GSH_CHEST"/journal.txt "$GSH_TMP/journal.txt" + [ -f "$GSH_TMP/journal.txt" ] && cp "$GSH_TMP"/journal.txt "$GSH_CHEST/journal.txt" return 1 fi ;; *) echo "$(eval_gettext "Your alias doesn't use the command '\$EDITOR'...")" + # save real journal.txt from the chest + [ -f "$GSH_CHEST/journal.txt" ] && cp "$GSH_CHEST"/journal.txt "$GSH_TMP/journal.txt" find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf + [ -f "$GSH_TMP/journal.txt" ] && cp "$GSH_TMP"/journal.txt "$GSH_CHEST/journal.txt" return 1 ;; esac From 07ce6d0efa3bd9571c4cbda89752f4874dc13892 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 9 Feb 2024 11:07:04 +0100 Subject: [PATCH 011/103] random salt in passport.txt must call the RANDOM script explicitly --- start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index cc7b8fbf9..e02e58735 100755 --- a/start.sh +++ b/start.sh @@ -311,8 +311,8 @@ Do you want to remove it and start a new game? [y/N]') " _confirm_passport "$PASSPORT" && break done - printf '\n==========\nRANDOM=%d\n' $RANDOM >> "$PASSPORT" - + # some random part added to the file so that GSH_UID is randomized + printf '==========\nrandom salt: %d\n' "$("$GSH_ROOT/scripts/RANDOM")" >> "$PASSPORT" # Generation of a unique identifier for the the player. export GSH_UID="$(checksum < "$PASSPORT" | cut -c 1-40)" From 0d7197e773cb93adaceafeb543945e3f910e9ea3 Mon Sep 17 00:00:00 2001 From: The GrocK <122747983+grock@users.noreply.github.com> Date: Sat, 9 Mar 2024 11:01:40 -0500 Subject: [PATCH 012/103] Fix typo. Replaced "you" by "your" in the sentence "... Merlin is about to test [you] speed ..." --- .../02_stdin_redirection_multiplications/goal/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/goal/en.txt b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/goal/en.txt index f50ea4591..c472e8511 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/goal/en.txt +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/goal/en.txt @@ -3,7 +3,7 @@ Mission goal To get better in the magical art, one needs to know mental math. -Get ready, because Merlin is about to test you speed with products. +Get ready, because Merlin is about to test your speed with products. Run the command ``gsh check`` to start. From 059f56737c55dd8d9895fc8a80e11fe542e1c8f6 Mon Sep 17 00:00:00 2001 From: The GrocK <122747983+grock@users.noreply.github.com> Date: Sat, 9 Mar 2024 11:03:26 -0500 Subject: [PATCH 013/103] Fix typo. Replaced "eth" by "the" in the sentence "Modifies the permissions for [eth] file (or directory).". --- missions/permissions/02_chmod_r_file_king_quarter/goal/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/permissions/02_chmod_r_file_king_quarter/goal/en.txt b/missions/permissions/02_chmod_r_file_king_quarter/goal/en.txt index c7dfec26c..5f115c3de 100644 --- a/missions/permissions/02_chmod_r_file_king_quarter/goal/en.txt +++ b/missions/permissions/02_chmod_r_file_king_quarter/goal/en.txt @@ -20,7 +20,7 @@ ls -l Access permissions are listed first on each line. chmod [OPTIONS] FILE - Modifies the permissions for eth file (or directory). + Modifies the permissions for the file (or directory). Refer to the manual to discover which options are available. From fedbcc8cdeb9ecbf7ccfee9fddc07638a8edbaea Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Mar 2024 09:06:44 +0100 Subject: [PATCH 014/103] apparently, "FROM" is better than "from" in Dockerfiles --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 8a21c0932..2f6e1d7c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -from debian:stable +FROM debian:stable ### # install dependencies From f08bc7a276690cb6b0dfeb5de4cf793f1c9f8164 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Mar 2024 09:20:53 +0100 Subject: [PATCH 015/103] minor changes in templates generated by new_mission.sh script --- utils/new_mission.sh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/utils/new_mission.sh b/utils/new_mission.sh index f302af2b7..439951c24 100755 --- a/utils/new_mission.sh +++ b/utils/new_mission.sh @@ -35,8 +35,8 @@ EOF new_goal_txt_file() { MISSION_DIR="$1" cat <<'EOF' > "$MISSION_DIR"/goal.txt -This file or one of its more complex variants (refer to the documentation) is -required. +This file or one of its more complex variants (refer to the documentation) +is required. It is displayed in its entirety by the command $ gsh goal @@ -69,8 +69,8 @@ EOF Mission goal ============ -This file or one of its more complex variants (refer to the documentation) is -required. +This file or one of its more complex variants (refer to the documentation) +is required. It is displayed in its entirety by the command $ gsh goal @@ -108,7 +108,7 @@ new_init_file() { # # It typically looks like _mission_init() { - ... + # ... } _mission_init EOF @@ -130,7 +130,7 @@ new_check_file() { # It typically looks like _mission_check() { - ... + # ... } _mission_check EOF @@ -188,9 +188,9 @@ EOF new_treasure_msg_file() { MISSION_DIR="$1" cat <<'EOF' > "$MISSION_DIR"/_treasure-msg.txt -This file is not required. When it exists, it is displayed when sourcing the -"treasure.sh" file. (If no "treasure.sh" file exists, this file will be -ignored.) +This file is not required. When it exists, it is displayed when sourcing +the "treasure.sh" file. (If no "treasure.sh" file exists, this file will +be ignored.) EOF } @@ -212,9 +212,9 @@ EOF mkdir "$MISSION_DIR/treasure-msg/" cat <<'EOF' > "$MISSION_DIR"/treasure-msg/en.txt -This file is not required. When it exists, it is displayed when sourcing the -"treasure.sh" file. (If no "treasure.sh" file exists, this file will be -ignored.) +This file is not required. When it exists, it is displayed when sourcing +the "treasure.sh" file. (If no "treasure.sh" file exists, this file will +be ignored.) EOF } From 7ac21f63d8e86f8151f21614ebe5adc8c94be8a5 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Mar 2024 09:58:22 +0100 Subject: [PATCH 016/103] update workflow files --- .github/workflows/latest_game_archive.yml | 4 ++-- .github/workflows/tag_release.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/latest_game_archive.yml b/.github/workflows/latest_game_archive.yml index 8958b038a..fa5c7f811 100644 --- a/.github/workflows/latest_game_archive.yml +++ b/.github/workflows/latest_game_archive.yml @@ -8,11 +8,11 @@ on: - "*" jobs: - gh_pre_release: + pre-release: runs-on: "ubuntu-latest" steps: - name: "Checkout source code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: fetch-depth: 0 diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index debdefb00..4aafb47ef 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -6,11 +6,11 @@ on: - "v*" jobs: - gh_pre_release: + pre-release: runs-on: "ubuntu-latest" steps: - name: "Checkout source code" - uses: "actions/checkout@v3" + uses: "actions/checkout@v4" with: fetch-depth: 0 From 0d51109a14cff498c74f1f9bc0339d1c30a92c9d Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Tue, 7 May 2024 11:45:29 +0200 Subject: [PATCH 017/103] fix 16 for italian Tiny typo otherwise the mission is not finishable --- missions/intermediate/02_alias_journal/goal/it.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/intermediate/02_alias_journal/goal/it.txt b/missions/intermediate/02_alias_journal/goal/it.txt index 2cdb8c2a6..d9c96b9d5 100644 --- a/missions/intermediate/02_alias_journal/goal/it.txt +++ b/missions/intermediate/02_alias_journal/goal/it.txt @@ -1,7 +1,7 @@ Obiettivi Missione ============ -Creare un alias "journal" in modo da editare il tuo file storico +Creare un alias "storico" in modo da editare il tuo file storico ovunque tu sia. From afb5b6376c8cbc2df7556ba6e8f2c507e89929cb Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Tue, 7 May 2024 11:50:34 +0200 Subject: [PATCH 018/103] Update it.txt --- missions/basic/04_mkdir_chest/goal/it.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/basic/04_mkdir_chest/goal/it.txt b/missions/basic/04_mkdir_chest/goal/it.txt index d5e7534bb..98bbf3118 100644 --- a/missions/basic/04_mkdir_chest/goal/it.txt +++ b/missions/basic/04_mkdir_chest/goal/it.txt @@ -1,7 +1,7 @@ Obiettivi Missione ============ -Costruisci una "Capanna" nella foresta e anche un "Cassa" +Costruisci una "Capanna" nella foresta e anche una "Cassa" nella capanna. From e74b578b3535ea80b690d2184efabebb50a2d1f1 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 6 May 2024 22:41:06 +0200 Subject: [PATCH 019/103] no need to copy gshrc to $GSH_CONFIG --- start.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/start.sh b/start.sh index e02e58735..23f6f11f2 100755 --- a/start.sh +++ b/start.sh @@ -269,7 +269,6 @@ Do you want to remove it and start a new game? [y/N]') " mkdir -p "$GSH_CONFIG" awk -v seed_file="$GSH_CONFIG/PRNG_seed" 'BEGIN { srand(); printf("%s", int(2^32 * rand())) > seed_file; }' - cp "$GSH_LIB/gshrc" "$GSH_CONFIG" # save current locale locale > "$GSH_CONFIG"/config.sh From 4b0e3e1c0d238e32390946f5787212cb2c6787de Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 01:20:26 +0200 Subject: [PATCH 020/103] actions/checkout@v4 in tests workflow --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ea00681fb..69de29205 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,7 +8,7 @@ jobs: runs-on: ${{ matrix.platform }} steps: - name: Checkout the GameShell repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - if: ${{ matrix.platform == 'ubuntu-latest' }} name: Install Linux deps run: | From 57d281f284b4c09952c4b3646cdda0d3a585a474 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 01:12:10 +0200 Subject: [PATCH 021/103] forgot to remove .tmp directory in "clean" rule --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d4e78e01f..b5253f14f 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ tests-zsh: clean clean: rm -rf i18n/*~ locale gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk - rm -rf .bin .config .sbin .var World + rm -rf .bin .config .sbin .var .tmp World rm -rf "game shell"* .PHONY: clean new FORCE From 1ef80c8b9ad629a92edf76e5bc674cd5782702fd Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 7 May 2024 13:22:32 +0200 Subject: [PATCH 022/103] document "gsh goal " in help message it was only documented in the full "HELP" message --- i18n/gameshell-help/en.txt | 3 ++- i18n/gameshell-help/fr.txt | 3 ++- i18n/gameshell-help/it.txt | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/i18n/gameshell-help/en.txt b/i18n/gameshell-help/en.txt index 42de0e471..c3af6de8f 100644 --- a/i18n/gameshell-help/en.txt +++ b/i18n/gameshell-help/en.txt @@ -10,8 +10,9 @@ gsh exit / Control-d (you can start from the current mission by running GameShell with the "-C" flag) -gsh goal +gsh goal [n] show the current mission's goal + if n is given, show the goal for mission n gsh help shorter help message diff --git a/i18n/gameshell-help/fr.txt b/i18n/gameshell-help/fr.txt index 031166128..afafdeeb3 100644 --- a/i18n/gameshell-help/fr.txt +++ b/i18n/gameshell-help/fr.txt @@ -10,8 +10,9 @@ gsh exit / Control-d (vous pouvez recommencer à la mission courante en lançant GameShell avec l'option "-C") -gsh goal +gsh goal [N] affiche l'objectif de la mission en cours + si N est donné, affiche l'objectif de la mission N gsh help affiche ce message diff --git a/i18n/gameshell-help/it.txt b/i18n/gameshell-help/it.txt index 7fbedf50c..b504b28fd 100644 --- a/i18n/gameshell-help/it.txt +++ b/i18n/gameshell-help/it.txt @@ -10,8 +10,9 @@ gsh exit / Control-d (puoi partire dalla missione corrente eseguendo GameShell con il parametro "-C") -gsh goal - mostra gli obiettivi di questa missione +gsh goal [N] + mostra gli obiettivi della missione + se N è fornito, mostra gli obiettivi della missione N gsh help messaggio di aiuto breve From b94d743d5d350f5cb8d81d29567f86ccfee33fd0 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 7 May 2024 21:31:38 +0200 Subject: [PATCH 023/103] make sure the PRNG seed is uncorrupted this could happen when the RANDOM / random_string process is interrupted as the wrong time (For example during the upcoming "control-c" mission...) --- scripts/RANDOM | 14 ++++++++++++++ scripts/random_string | 14 ++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/scripts/RANDOM b/scripts/RANDOM index 029b2d7fe..ff0123bca 100755 --- a/scripts/RANDOM +++ b/scripts/RANDOM @@ -15,3 +15,17 @@ awk -v seed_file="$GSH_CONFIG/PRNG_seed" -v n="$n" -v PID=$$ 'BEGIN { } if (seed) printf("%d\n", int(2^30 * rand())+PID) > seed_file; }' + +# make sure the seed is not corrupted / empty +# (it could happen if the process is interrupted at the wrong time) +if [ -d "$GSH_CONFIG" ] +then + case "$(cat "$GSH_CONFIG/PRNG_seed" 2>/dev/null)" in + "" | *[!0-9]*) + awk -v seed_file="$GSH_CONFIG/PRNG_seed" 'BEGIN { srand(); printf("%s", int(2^32 * rand())) > seed_file; }' + ;; + *) + : + ;; + esac +fi diff --git a/scripts/random_string b/scripts/random_string index f9179b582..3b363d16a 100755 --- a/scripts/random_string +++ b/scripts/random_string @@ -14,3 +14,17 @@ awk -v n=${n:-32} -v seed_file="$GSH_CONFIG/PRNG_seed" -v PID=$$ 'BEGIN { printf("\n"); if (seed) printf("%d\n", int(2^30 * rand())+PID) > seed_file; }' + +# make sure the seed is not corrupted / empty +# (it could happen if the process is interrupted at the wrong time) +if [ -d "$GSH_CONFIG" ] +then + case "$(cat "$GSH_CONFIG/PRNG_seed" 2>/dev/null)" in + "" | *[!0-9]*) + awk -v seed_file="$GSH_CONFIG/PRNG_seed" 'BEGIN { srand(); printf("%s", int(2^32 * rand())) > seed_file; }' + ;; + *) + : + ;; + esac +fi From 3284a0a25790a9322c3616ce4173f7061d40e879 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 01:06:02 +0200 Subject: [PATCH 024/103] old bug in reflow.awk paragraph indentation was lost when they were reflowed --- scripts/reflow.awk | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/reflow.awk b/scripts/reflow.awk index 15b469440..260b4744b 100755 --- a/scripts/reflow.awk +++ b/scripts/reflow.awk @@ -140,14 +140,14 @@ BEGIN { # if a paragraph starts with a list marker # don't forget to remove the list marker! if (match($0, /^ *[-+] */)) { - par_indent = substr($0, 1, Rwcscolumns); - $0 = substr($0, Rwcscolumns+1); + par_indent = substr($0, 1, RLENGTH); + $0 = substr($0, RLENGTH+1); } else if (match($0, /^ *[0-9][0-9]*[.\/] */)) { - par_indent = substr($0, 1, Rwcscolumns); - $0 = substr($0, Rwcscolumns+1); + par_indent = substr($0, 1, RLENGTH); + $0 = substr($0, RLENGTH+1); } else { match($0, /^ */); - par_indent = substr($0, 1, Rwcscolumns); + par_indent = substr($0, 1, RLENGTH); } } From 6e8b4ed3b7ae908428a77548a09e35877b6fd98e Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 13:06:04 +0200 Subject: [PATCH 025/103] cleaning some temporary files in gameshell I'm not sure why, but even after this commit, while running in debug mode, some temporary environment files (the "env_before" and "env_after" files) still do not get deleted. --- lib/bin_test.sh | 2 ++ lib/gsh.sh | 4 +++- lib/gshrc | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/bin_test.sh b/lib/bin_test.sh index 2c563f45a..8b832a1d7 100644 --- a/lib/bin_test.sh +++ b/lib/bin_test.sh @@ -6,11 +6,13 @@ test_mktemp() ( if ! tmp=$(mktemp 2>/dev/null) then echo "Error: command 'mktemp' not working." >&2 + rm -f "$tmp" return 1 fi if [ -z "$tmp" ] then echo "Error: command 'mktemp' returned the empty string." >&2 + rm -f "$tmp" return 1 fi rm -f "$tmp" diff --git a/lib/gsh.sh b/lib/gsh.sh index 3d3b2ff6a..f369c04b2 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -261,12 +261,14 @@ __gsh_start() { then echo "$(gettext "Error: no mission was found! Aborting.")" >&2 + rm -f "$env_before" "$env_after" exit 1 fi color_echo yellow "$(eval_gettext "Error: mission \$MISSION_NB is cancelled because some dependencies are not met.")" >&2 GSH_CANCELLED=$GSH_CANCELLED:$MISSION_NB __log_action "$MISSION_NB" "CANCEL_DEP_PB" __gsh_start "$((MISSION_NB + 1))" + rm -f "$env_before" "$env_after" return fi unset GSH_CANCELLED @@ -281,10 +283,10 @@ Aborting.")" >&2 Run the command \$ gsh reset to make sure the mission is initialized properly.")" >&2 - rm -f "$env_before" "$env_after" fi fi fi + rm -f "$env_before" "$env_after" __log_action "$MISSION_NB" "START" diff --git a/lib/gshrc b/lib/gshrc index cb1c0540a..60f975896 100644 --- a/lib/gshrc +++ b/lib/gshrc @@ -28,7 +28,7 @@ if [ -s "$tempfile" ] then export PAGER=more fi -rm -f "$mktemp" +rm -f "$tempfile" # try to prevent using sudo and similar su() { From 6b2d8140d0e00e10973709cecc5bc7e1580e6a64 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 13:07:02 +0200 Subject: [PATCH 026/103] cleaning temporary files in missions a couple of missions didn't clean after themselves --- missions/intermediate/04_bg_xeyes/check.sh | 6 ++- missions/processes/00_shared/init.sh | 2 + .../clean.sh | 2 +- .../init.sh | 43 ++++++++++--------- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/missions/intermediate/04_bg_xeyes/check.sh b/missions/intermediate/04_bg_xeyes/check.sh index 525be23ef..812ab8223 100644 --- a/missions/intermediate/04_bg_xeyes/check.sh +++ b/missions/intermediate/04_bg_xeyes/check.sh @@ -23,9 +23,11 @@ _mission_check() { then echo "$(gettext "There is no 'xeyes' process running.")" ps -e | awk '/xeyes/ {print $1}' | xargs kill -9 2> /dev/null - false + rm -f "$tmp_file" + return 1 else - true + rm -f "$tmp_file" + return 0 fi } diff --git a/missions/processes/00_shared/init.sh b/missions/processes/00_shared/init.sh index bfe081a2f..e40e1f877 100644 --- a/missions/processes/00_shared/init.sh +++ b/missions/processes/00_shared/init.sh @@ -1,5 +1,7 @@ #!/usr/bin/env sh +trap 'rm -f "$GSH_TMP/test-proc-name"' EXIT + # use a subshell, that should guarantee that no message is displayed when the # test-proc-name process is killed. _mission_init() ( diff --git a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/clean.sh b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/clean.sh index 160bee27a..9520ebb16 100644 --- a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/clean.sh +++ b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/clean.sh @@ -1,3 +1,3 @@ #!/usr/bin/env sh -rm -f "$GSH_TMP/secret_key" +rm -f "$GSH_TMP/secret_key" "$GSH_TMP/merlin" diff --git a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/init.sh b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/init.sh index 865336d66..996ea8f6d 100644 --- a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/init.sh +++ b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/init.sh @@ -24,27 +24,30 @@ _mission_init() ( if [ -n "$CC" ] then - ( - # in debug mode, don't hide messages - if [ "$GSH_MODE" != DEBUG ] || [ -z "$GSH_VERBOSE_DEBUG" ] - then - exec 1>/dev/null - exec 2>/dev/null - fi + if ! [ -x "$GSH_TMP/merlin" ] + then + ( + # in debug mode, don't hide messages + if [ "$GSH_MODE" != DEBUG ] || [ -z "$GSH_VERBOSE_DEBUG" ] + then + exec 1>/dev/null + exec 2>/dev/null + fi - # under BSD, libintl is installed in /usr/local and we need to pass - # "-lintl" to the compiler, so we have to try several things! - { - echo "GSH: compiling merlin.c, first try" >&2 - echo $CC "$MISSION_DIR/merlin.c" -o "$GSH_TMP/merlin" - $CC "$MISSION_DIR/merlin.c" -o "$GSH_TMP/merlin" - } || - { - echo "GSH: compiling merlin.c, second try" - echo $CC -I/usr/local/include/ -L/usr/local/lib "$MISSION_DIR/merlin.c" -lintl -o "$GSH_TMP/merlin" - $CC -I/usr/local/include/ -L/usr/local/lib "$MISSION_DIR/merlin.c" -lintl -o "$GSH_TMP/merlin" - } - ) || { echo "compilation failed" >&2; return 1; } + # under BSD, libintl is installed in /usr/local and we need to pass + # "-lintl" to the compiler, so we have to try several things! + { + echo "GSH: compiling merlin.c, first try" >&2 + echo $CC "$MISSION_DIR/merlin.c" -o "$GSH_TMP/merlin" + $CC "$MISSION_DIR/merlin.c" -o "$GSH_TMP/merlin" + } || + { + echo "GSH: compiling merlin.c, second try" + echo $CC -I/usr/local/include/ -L/usr/local/lib "$MISSION_DIR/merlin.c" -lintl -o "$GSH_TMP/merlin" + $CC -I/usr/local/include/ -L/usr/local/lib "$MISSION_DIR/merlin.c" -lintl -o "$GSH_TMP/merlin" + } + ) || { echo "compilation failed" >&2; return 1; } + fi copy_bin "$GSH_TMP/merlin" "$(eval_gettext '$GSH_HOME/Castle/Observatory')/merlin" else copy_bin "$MISSION_DIR"/merlin.sh "$(eval_gettext '$GSH_HOME/Castle/Observatory')/merlin" From 2e5c19050e2462a484f274b74b45481125beba99 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 16:37:26 +0200 Subject: [PATCH 027/103] "clean" rule tried to remove .var directory which doesn't exist anymore --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index b5253f14f..90e09727e 100644 --- a/Makefile +++ b/Makefile @@ -56,7 +56,7 @@ tests-zsh: clean clean: rm -rf i18n/*~ locale gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk - rm -rf .bin .config .sbin .var .tmp World + rm -rf .bin .config .sbin .tmp World rm -rf "game shell"* .PHONY: clean new FORCE From 504e6d8142ccba7f638a6c4c0481ab01a3c011d0 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 18:32:31 +0200 Subject: [PATCH 028/103] some cleaning in how CLI options are handled --- i18n/start-help/en.txt | 6 +-- i18n/start-help/fr.txt | 6 +-- i18n/start-help/it.txt | 6 +-- lib/header.sh | 110 +++++++++++++++++++++-------------------- start.sh | 31 +++++------- utils/archive.sh | 41 ++++++--------- 6 files changed, 93 insertions(+), 107 deletions(-) diff --git a/i18n/start-help/en.txt b/i18n/start-help/en.txt index 0904d250f..2e52391ab 100644 --- a/i18n/start-help/en.txt +++ b/i18n/start-help/en.txt @@ -16,12 +16,12 @@ options: On non GNU systems, set the variable LC_MESSAGES to a valid locale. - --simple-savefiles + -S simple the savefile is obtained by adding a "-save" suffix, each savefile overwrites the previous one - --index-savefiles + -S index savefiles are numbered so that all savefiles are kept - --overwrite-savefiles + -S overwrite the savefile overwrite the initial GameShell file (you can use option -R to start a new game from the start) diff --git a/i18n/start-help/fr.txt b/i18n/start-help/fr.txt index 98cfa676a..e7ab178e9 100644 --- a/i18n/start-help/fr.txt +++ b/i18n/start-help/fr.txt @@ -17,13 +17,13 @@ options : Pour les systèmes non GNU, initialisez la variable LC_MESSAGES avec une locale valide. - --simple-savefiles + -S simple le fichier de sauvegarde est obtenu en ajoutant un suffix "-save", chaque fichier de sauvegarde remplace le précédent - --index-savefiles + -S index les fichiers de sauvegarde sont numérotés pour que toutes les sauvegardes soient conservées - --overwrite-savefiles + -S overwrite le fichier de sauvegarde remplace l'instance initial de GameShell (on peut utiliser l'option -R pour lancer une partie à partir du début) diff --git a/i18n/start-help/it.txt b/i18n/start-help/it.txt index bc5355b97..000ea47e5 100644 --- a/i18n/start-help/it.txt +++ b/i18n/start-help/it.txt @@ -16,12 +16,12 @@ options: Su sistemi non GNU, imposta la variabile LC_MESSAGES per un "locale" valido. - --simple-savefiles + -S simple il file di salvataggio è generato con un suffiso "-save", ogni salvataggio sovrascrive il precedente - --index-savefiles + -S index i salvataggi sono numerati così sono tutti conservati - --overwrite-savefiles + -S overwrite il salvataggio sovrascrive il file iniziale di GameShell (puoi utilizzare l'opzione -R per avviare un nuovo gioco dall'inizio) diff --git a/lib/header.sh b/lib/header.sh index 9d77dfacf..37fee62a1 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -34,61 +34,65 @@ GSH_EXEC_DIR=$(cd "$GSH_EXEC_DIR"; pwd -P) # just in case GSH_EXEC_DIR=${GSH_EXEC_DIR:-.} -for arg in "$@" +while getopts "VUXKFh" opt do - if [ "$arg" = "-V" ] - then - echo "Gameshell $GSH_VERSION" - if [ -n "$GSH_LAST_CHECKED_MISSION" ] - then - echo "saved game: [mission $GSH_LAST_CHECKED_MISSION] OK" - fi - exit 0 - elif [ "$arg" = "-U" ] - then - TARGET="$GSH_EXEC_DIR/gameshell.sh" - TMPFILE="$GSH_EXEC_DIR/gameshell.sh$$" - if command -v wget >/dev/null - then - if wget -O "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh - then - mv "$TMPFILE" "$TARGET" - chmod +x "$TARGET" - echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" - exit 0 - else - rm -f "$TMPFILE" - echo "Error: couldn't download or save the latest version of GameShell." >&2 - exit 1 - fi - elif command -v curl >/dev/null - then - if curl -fo "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh - then - mv "$TMPFILE" "$TARGET" - chmod +x "$TARGET" - echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" + case "$opt" in + V) + echo "Gameshell $GSH_VERSION" + if [ -n "$GSH_LAST_CHECKED_MISSION" ] + then + echo "saved game: [mission $GSH_LAST_CHECKED_MISSION] OK" + fi exit 0 - else - rm -f "$TMPFILE" - echo "Error: couldn't download or save the latest version of GameShell." >&2 - exit 1 - fi - fi - elif [ "$arg" = "-X" ] - then - GSH_EXTRACT="true" - elif [ "$arg" = "-K" ] - then - KEEP_DIR="true" - elif [ "$arg" = "-F" ] - then - GSH_FORCE="true" - elif [ "$arg" = "-h" ] - then - # used to avoid checking for more recent files - GSH_HELP="true" - fi + ;; + U) + TARGET="$GSH_EXEC_DIR/gameshell.sh" + TMPFILE="$GSH_EXEC_DIR/gameshell.sh$$" + if command -v wget >/dev/null + then + if wget -O "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh + then + mv "$TMPFILE" "$TARGET" + chmod +x "$TARGET" + echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" + exit 0 + else + rm -f "$TMPFILE" + echo "Error: couldn't download or save the latest version of GameShell." >&2 + exit 1 + fi + elif command -v curl >/dev/null + then + if curl -fo "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh + then + mv "$TMPFILE" "$TARGET" + chmod +x "$TARGET" + echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" + exit 0 + else + rm -f "$TMPFILE" + echo "Error: couldn't download or save the latest version of GameShell." >&2 + exit 1 + fi + fi + ;; + X) + GSH_EXTRACT="true" + ;; + K) + KEEP_DIR="true" + ;; + F) + GSH_FORCE="true" + ;; + h) + # used to avoid checking for more recent files + GSH_HELP="true" + ;; + *) + # ignore other options, they will be passed to start.sh + ;; + esac done diff --git a/start.sh b/start.sh index 23f6f11f2..9c9819059 100755 --- a/start.sh +++ b/start.sh @@ -37,28 +37,19 @@ GSH_MODE="ANONYMOUS" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" -# hack to parse long options --index-savefiles --overwrite-savefiles --simple-savefiles -# cf https://stackoverflow.com/questions/402377/using-getopts-to-process-long-and-short-command-line-options -_long_option=0 -while getopts ":hnPdDACRXUVqGL:KBZc:F-:" opt +while getopts "hnPdDACRXUVqGL:KBZc:FS:" opt do - if [ "$opt" = "-" ] - then - opt="${OPTARG%%=*}" # extract long option name - OPTARG="${OPTARG#$opt}" # extract long option argument (may be empty) - OPTARG="${OPTARG#=}" # if long option argument, remove assigning `=` - _long_option=1 - fi - case $opt in - index-savefiles) - GSH_SAVEFILE_MODE=index - ;; - simple-savefiles) - GSH_SAVEFILE_MODE=simple - ;; - overwrite-savefiles) - GSH_SAVEFILE_MODE=overwrite + S) + case "$OPTARG" in + "index" | "simple" | "overwrite") + GSH_SAVEFILE_MODE=$OPTARG + ;; + *) + echo "$(gettext "Error: save mode can only be 'index', 'simple' or 'overwrite'")" >&2 + exit 1 + ;; + esac ;; h) display_help diff --git a/utils/archive.sh b/utils/archive.sh index 61597f977..9781601f9 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -11,7 +11,7 @@ create a GameShell standalone archive options: -h this message - --password=... choose password for admin commands + -p ... choose password for admin commands -P use the "passport mode" by default when running GameShell -A use the "anonymous mode" by default when running GameShell -L LANGS only keep the given languages (ex: -L 'en*,fr') @@ -20,9 +20,9 @@ options: -N ... name of the archive / top directory (default: "gameshell") - --simple-savefiles - --index-savefiles - --overwrite-savefiles + -S simple + -S index + -S overwrite choose default savefile mode -a keep 'auto.sh' scripts for missions that have one @@ -62,38 +62,29 @@ KEEP_PO=0 # this is set to 1 if we generate .mo files. Setting it to 1 here LANGUAGES="" VERBOSE= -# hack to parse long option --password -# cf https://stackoverflow.com/questions/402377/using-getopts-to-process-long-and-short-command-line-options -_long_option=0 -while getopts ":hp:N:atPzL:Ev-:" opt +while getopts "hp:N:atPzL:EvS:p:" opt do - if [ "$opt" = "-" ] - then - opt="${OPTARG%%=*}" # extract long option name - OPTARG="${OPTARG#"$opt"}" # extract long option argument (may be empty) - OPTARG="${OPTARG#=}" # if long option argument, remove assigning `=` - _long_option=1 - fi - case $opt in h) display_help exit 0; ;; - password) + p) ADMIN_PASSWD=$OPTARG ;; N) NAME=$OPTARG ;; - index-savefiles) - GSH_SAVEFILE_MODE=index - ;; - simple-savefiles) - GSH_SAVEFILE_MODE=simple - ;; - overwrite-savefiles) - GSH_SAVEFILE_MODE=overwrite + S) + case "$OPTARG" in + "index" | "simple" | "overwrite") + GSH_SAVEFILE_MODE=$OPTARG + ;; + *) + echo "Error: save mode can only be 'index', 'simple' or 'overwrite'" >&2 + exit 1 + ;; + esac ;; a) KEEP_AUTO=1 From 480f93db58a4ef1929ee890bacc68be597f06d52 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 7 May 2024 13:49:07 +0200 Subject: [PATCH 029/103] add a recurring help message for the first 3 missions Following a good suggestion from @leroivi during the first 3 missions, each prompt is preceeded by a line [use 'gsh help' to get a list of available commands] so that people who've never used a shell don't forget about that. This is disabled when the "quiet" option is given ("-q"), or when gameshell is run in debug mode ("-d" or "-D"). (If needs be, this can be deactivated by setting the "GSH_HELP_HINT" variable to "never"; and can be kept beyond the first 3 missions by setting the "GSH_HELP_HINT" variable to "always".) --- i18n/en.po | 3 + i18n/fr.po | 7 +- i18n/it.po | 492 ++++++++++++++++++++++------------------------ i18n/template.pot | 3 + lib/bashrc | 1 + lib/gsh.sh | 1 + lib/gshrc | 14 ++ lib/zshrc | 1 + 8 files changed, 260 insertions(+), 262 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index d5e3be3f3..e275f687c 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -294,5 +294,8 @@ msgstr "test $nb_tests failed" msgid "total time: %s" msgstr "total time: %s" +msgid "use 'gsh help' to get a list of available commands" +msgstr "use 'gsh help' to get a list of available commands" + msgid "y" msgstr "y" diff --git a/i18n/fr.po b/i18n/fr.po index bf4aa5fef..716a2d225 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -301,10 +301,9 @@ msgstr "test $nb_tests échoué" msgid "total time: %s" msgstr "temps total : %s" +msgid "use 'gsh help' to get a list of available commands" +msgstr "utilisez 'gsh help' pour obtenir une liste de commandes possibles" + # abbreviation for "yes" (lowercase) msgid "y" msgstr "o" - -#, fuzzy -#~ msgid "You shouldn't run Gameshell as root!" -#~ msgstr "Erreur: il ne faut pas lancer Gameshell avec l'utilisateur root !" diff --git a/i18n/it.po b/i18n/it.po index 08768f088..57da53e26 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -1,340 +1,316 @@ # Header entry was created by Lokalize. # -#, sh-format # mte90 , 2022. -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: mte90 \n" -"PO-Revision-Date: 2022-05-27 11:10+0200\n" -"Project-Id-Version: \n" -"Language-Team: Italian \n" -"Language: it_IT\n" -"MIME-Version: 1.0\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 22.04.1\n" +msgid "" +msgstr "Project-Id-Version: \n" + "PO-Revision-Date: 2022-05-27 11:10+0200\n" + "Last-Translator: mte90 \n" + "Language-Team: Italian \n" + "Language: it_IT\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + "X-Generator: Lokalize 22.04.1\n" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-HELP/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-HELP/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-help/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-help/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-init-msg-short/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-init-msg-short/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-init-msg/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-init-msg/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-init-msg/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-init-msg/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-welcome/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-welcome/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/start-help/en.txt" -msgstr "$GSH_ROOT/i18n/start-help/it.txt" +msgid "$GSH_ROOT/i18n/start-help/en.txt" +msgstr "$GSH_ROOT/i18n/start-help/it.txt" #, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" #, sh-format -msgid "$MISSION_DIR/skip/en.txt" -msgstr "$MISSION_DIR/skip/it.txt" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/it.txt" #, sh-format -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "$MISSION_DIR/treasure-msg/it.txt" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/it.txt" #, sh-format -msgid "$nb_failed_tests failures out of $nb_tests tests" -msgstr "$nb_failed_tests fallimenti su $nb_tests test" +msgid "$nb_failed_tests failures out of $nb_tests tests" +msgstr "$nb_failed_tests fallimenti su $nb_tests test" #, sh-format -msgid "$nb_tests successful tests" -msgstr "$nb_tests prove riuscite" +msgid "$nb_tests successful tests" +msgstr "$nb_tests prove riuscite" #, awk-format -msgid "%d authentification failure" -msgid_plural "%d authentification failures" -msgstr[0] "%d autenticazione fallita" -msgstr[1] "%d autenticazioni fallite" +msgid "%d authentification failure" +msgid_plural "%d authentification failures" +msgstr[0] "%d autenticazione fallita" +msgstr[1] "%d autenticazioni fallite" #, awk-format -msgid "%d mission cancelled for missing dependencies:" -msgid_plural "%d missions cancelled for missing dependencies:" -msgstr[0] "%d missione annullata per dipendenze mancanti:" -msgstr[1] "%d missioni annullate per dipendenze mancanti:" +msgid "%d mission cancelled for missing dependencies:" +msgid_plural "%d missions cancelled for missing dependencies:" +msgstr[0] "%d missione annullata per dipendenze mancanti:" +msgstr[1] "%d missioni annullate per dipendenze mancanti:" #, awk-format -msgid "%d mission passed using the auto.sh script:" -msgid_plural "%d missions passed using the auto.sh script:" -msgstr[0] "%d missione riuscita usando lo script auto.sh:" -msgstr[1] "%d missioni riuscite usando lo script auto.sh:" +msgid "%d mission passed using the auto.sh script:" +msgid_plural "%d missions passed using the auto.sh script:" +msgstr[0] "%d missione riuscita usando lo script auto.sh:" +msgstr[1] "%d missioni riuscite usando lo script auto.sh:" #, awk-format -msgid "%d mission passed:" -msgid_plural "%d missions passed:" -msgstr[0] "%d missione compiuta:" -msgstr[1] "%d missioni compiute:" +msgid "%d mission passed:" +msgid_plural "%d missions passed:" +msgstr[0] "%d missione compiuta:" +msgstr[1] "%d missioni compiute:" #, awk-format -msgid "%d mission skipped:" -msgid_plural "%d missions skipped:" -msgstr[0] "%d missione saltata:" -msgstr[1] "%d missioni saltate:" +msgid "%d mission skipped:" +msgid_plural "%d missions skipped:" +msgstr[0] "%d missione saltata:" +msgstr[1] "%d missioni saltate:" -msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" -msgstr "GENERATO ALL'AVVIO AUTOMATICAMENTE -- NON MODIFICARE" +msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" +msgstr "GENERATO ALL'AVVIO AUTOMATICAMENTE -- NON MODIFICARE" #, sh-format -msgid "Congratulations, mission $MISSION_NB has been successfully completed!" -msgstr "Congratulazioni, la missione $MISSION_NB é stata completata con successo!" +msgid "Congratulations, mission $MISSION_NB has been successfully completed!" +msgstr "Congratulazioni, la missione $MISSION_NB é stata completata con successo!" #, sh-format -msgid "Error: _gsh_assert_check only accept 'true' and 'false' as argument." -msgstr "" -"Errore: _gsh_assert_check accetta solamente `true` o `false` come argomento." +msgid "Error: _gsh_assert_check only accept 'true' and 'false' as argument." +msgstr "Errore: _gsh_assert_check accetta solamente `true` o `false` come argomento." -msgid "" -"Error: a least one base function is not working properly.\n" -"Aborting!" -msgstr "" -"Errore: almeno una delle funzioni base non funziona correttamente.\n" -"Interrompo!" +msgid "Error: a least one base function is not working properly.\n" + "Aborting!" +msgstr "Errore: almeno una delle funzioni base non funziona correttamente.\n" + "Interrompo!" #, sh-format -msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" -msgstr "" -"Errore: non é stato possibile ottenere il numero $MISSION_NB (da $fn_name)" +msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" +msgstr "Errore: non é stato possibile ottenere il numero $MISSION_NB (da $fn_name)" #, sh-format -msgid "Error: invalid option: '-$OPTARG'" -msgstr "Errore: opzione non valida: '-$OPTARG'" +msgid "Error: invalid option: '-$OPTARG'" +msgstr "Errore: opzione non valida: '-$OPTARG'" #, sh-format -msgid "Error: mission $MISSION_NB doesn't exist!" -msgstr "Errore: missione $MISSION_NB non esiste!" +msgid "Error: mission $MISSION_NB doesn't exist!" +msgstr "Errore: missione $MISSION_NB non esiste!" #, sh-format -msgid "Error: mission $MISSION_NB doesn't have a test script." -msgstr "Errore: missione $MISSION_NB non ha uno script di test." +msgid "Error: mission $MISSION_NB doesn't have a test script." +msgstr "Errore: missione $MISSION_NB non ha uno script di test." #, sh-format -msgid "Error: mission $MISSION_NB doesn't have an auto script." -msgstr "Errore: missione $MISSION_NB non ha uno script automatico." +msgid "Error: mission $MISSION_NB doesn't have an auto script." +msgstr "Errore: missione $MISSION_NB non ha uno script automatico." #, sh-format -msgid "" -"Error: mission $MISSION_NB is cancelled because some dependencies are not met." -msgstr "" -"Errore: missione $MISSION_NB é stata annullata perché alcune dipendenze non sono state trovate." - -msgid "" -"Error: no mission was found!\n" -"Aborting." -msgstr "" -"Errore: nessuna missione trovata!\n" -"Interruzione!" - -msgid "Error: the 'goto' command requires a mission number as argument." -msgstr "Errore: il comando 'goto' richiede un numero di missione come argomento.`" - -msgid "Error: the command 'gsh hardreset' shouldn't be run inside a subshell!" -msgstr "" -"Errore: il comando 'gsh hardreset' non dovrebbe essere eseguito dentro una" -" subshell!" - -msgid "Error: the command 'gsh reset' shouldn't be run inside a subshell!" -msgstr "" -"Errore: il comando 'gsh reset' non dovrebbe essere eseguito dentro una" -" subshell!" - -msgid "Error: this option is only available from an executable archive!" -msgstr "Errore: questa opzione é disponibile solo da un archivio eseguibile!" +msgid "Error: mission $MISSION_NB is cancelled because some dependencies are not met." +msgstr "Errore: missione $MISSION_NB é stata annullata perché alcune dipendenze non sono state trovate." + +msgid "Error: no mission was found!\n" + "Aborting." +msgstr "Errore: nessuna missione trovata!\n" + "Interruzione!" + +msgid "Error: the 'goto' command requires a mission number as argument." +msgstr "Errore: il comando 'goto' richiede un numero di missione come argomento.`" + +msgid "Error: the command 'gsh hardreset' shouldn't be run inside a subshell!" +msgstr "Errore: il comando 'gsh hardreset' non dovrebbe essere eseguito dentro una subshell!" + +msgid "Error: the command 'gsh reset' shouldn't be run inside a subshell!" +msgstr "Errore: il comando 'gsh reset' non dovrebbe essere eseguito dentro una subshell!" + +msgid "Error: this option is only available from an executable archive!" +msgstr "Errore: questa opzione é disponibile solo da un archivio eseguibile!" #, sh-format -msgid "" -"Error: unknown gsh command '$cmd'.\n" -"Use one of the following commands:" -msgstr "" -"Errore: comando gsh sconosciuto '$cmd@.\n" -"Usa uno dei comandi seguenti:" +msgid "Error: unknown gsh command '$cmd'.\n" + "Use one of the following commands:" +msgstr "Errore: comando gsh sconosciuto '$cmd@.\n" + "Usa uno dei comandi seguenti:" #, sh-format -msgid "" -"Error: unknown shell '$SHELL'.\n" -"Run GameShell with either bash or zsh." -msgstr "" -"Errore: shell sconosciuta '$SHELL'.\n" -"Avvia GameShell con bash o zsh." +msgid "Error: unknown shell '$SHELL'.\n" + "Run GameShell with either bash or zsh." +msgstr "Errore: shell sconosciuta '$SHELL'.\n" + "Avvia GameShell con bash o zsh." -msgid "Error: wrong password." -msgstr "Errore: password sbagliata." +msgid "Error: wrong password." +msgstr "Errore: password sbagliata." -msgid "Error: you are not allowed to run this command." -msgstr "Errore: non hai i permessi per eseguire questo comando." +msgid "Error: you are not allowed to run this command." +msgstr "Errore: non hai i permessi per eseguire questo comando." -msgid "Error: you shouldn't run Gameshell as root!" -msgstr "Errore: non dovresti eseguire Gameshell come root!" +msgid "Error: you shouldn't run Gameshell as root!" +msgstr "Errore: non dovresti eseguire Gameshell come root!" -msgid "Is this information correct? [Y/n]" -msgstr "Questa informazione é corretta? [S/n]" +msgid "Is this information correct? [Y/n]" +msgstr "Questa informazione é corretta? [S/n]" #, sh-format -msgid "Mission $MISSION_NB has been cancelled." -msgstr "La Missione $MISSION_NB é stata annullata." +msgid "Mission $MISSION_NB has been cancelled." +msgstr "La Missione $MISSION_NB é stata annullata." -msgid "N" -msgstr "N" +msgid "N" +msgstr "N" -msgid "Player's email:" -msgstr "Email giocatore:" +msgid "Player's email:" +msgstr "Email giocatore:" -msgid "Player's name:" -msgstr "Nome giocatore:" +msgid "Player's name:" +msgstr "Nome giocatore:" -msgid "Press Enter to continue." -msgstr "Premi Invio per continuare." +msgid "Press Enter to continue." +msgstr "Premi Invio per continuare." -msgid "START OF COMMANDS HISTORY" -msgstr "INIZIO DELLO STORICO COMANDI" +msgid "START OF COMMANDS HISTORY" +msgstr "INIZIO DELLO STORICO COMANDI" #, sh-format -msgid "Sorry, mission $MISSION_NB hasn't been completed." -msgstr "Spiacente, ma la missione $MISSION_NB non é stata completata." +msgid "Sorry, mission $MISSION_NB hasn't been completed." +msgstr "Spiacente, ma la missione $MISSION_NB non é stata completata." #, sh-format -msgid "" -"The directory $GSH_CONFIG contains meta-data from a previous game.\n" -"Do you want to remove it and start a new game? [y/N]" -msgstr "" -"La cartella $GSH_CONFIG contiene informazioni da una partita precedente.\n" -"Vuoi cancellare questi dati e lanciare una nuova partita?[s/N]" - -msgid "The latest version of Gameshell is available at" -msgstr "L'ultima versione di Gameshell é disponibile a" - -msgid "" -"There are stopped jobs in your session.\n" -"Those processes will be terminated.\n" -"You can get the list of those jobs with\n" -" $ jobs\n" -"Do you still want to quit? [y/n]" -msgstr "" -"Ci sono dei processi fermati nella tua sessione.\n" -"Questi processi verranno terminati.\n" -"Puoi ottenere la lista di questi processi con\n" -" $ jobs\n" -"Vuoi uscire lo stesso? [s/n\n]" - -msgid "" -"Warning: the file 'treasure.sh' was sourced from a subshell.\n" -"You should use the command\n" -" $ gsh reset" -msgstr "" -"Attenzione: il file 'treasure.sh' é stato caricato da una subshell.\n" -"Dovresti utilizzare il comando\n" -" $ gsh reset" - -msgid "" -"Warning: this mission was initialized in a subshell.\n" -"Run the command\n" -" $ gsh reset\n" -"to make sure the mission is initialized properly." -msgstr "" -"Attenzione: questa missione é stata avviato da una subshell.\n" -"Avvia il comando\n" -" $ gsh reset\n" -"per assicurarsi che la missione sia avviata correttamente." - -msgid "While you are waiting, a bat flies by..." -msgstr "Mentre tu stai aspettando, un pipistrello vola via..." - -msgid "While you are waiting, a caterpillar crawls by..." -msgstr "Mentre stai aspettando, un bruco striscia via..." - -msgid "While you are waiting, a centipede crawls by..." -msgstr "Mentre stai aspettando, un millipiede striscia via..." - -msgid "While you are waiting, a duck swims by..." -msgstr "Mentre stai aspettando, una papera nuota via..." - -msgid "While you are waiting, a fish swims by..." -msgstr "Mentre stai aspettando, un pesce nuota via..." - -msgid "While you are waiting, a large fish swims by..." -msgstr "Mentre stai aspettando, un grande pesce nuota via..." - -msgid "While you are waiting, a snail goes by..." -msgstr "Mentre stai aspettando, una lumaca va..." - -msgid "While you are waiting, a snake slithers by..." -msgstr "Mentre stai aspettando, un serpente svicola via..." - -msgid "While you are waiting, a spider crawls by..." -msgstr "Mentre stai aspettando, un ragno strisca via..." - -msgid "While you are waiting, an ant crawls by..." -msgstr "Mentre stai aspettando, una formica va via..." - -msgid "While you are waiting, you see a fish swimming in circles..." -msgstr "Mentre stai aspettando, vedi un pesce nuotare in cerchio..." - -msgid "Y" -msgstr "S" - -msgid "" -"You left GameShell's directory structure. Use\n" -" $ cd\n" -"to go back to the GameShell's starting directory." -msgstr "" -"Hai lasciato la struttura di cartelle di Gameshell . Usa\n" -" $ cd\n" -"per tornare indietro alla cartella iniziale di Gameshell." - -msgid "[Press space to continue, q to quit\\.]" -msgstr "[Premi invio per continuare, q per uscire\\.]" - -msgid "cancelled" -msgstr "annullato" - -msgid "completed" -msgstr "completato" - -msgid "days" -msgstr "giorni" - -msgid "failed" -msgstr "fallito" +msgid "The directory $GSH_CONFIG contains meta-data from a previous game.\n" + "Do you want to remove it and start a new game? [y/N]" +msgstr "La cartella $GSH_CONFIG contiene informazioni da una partita precedente.\n" + "Vuoi cancellare questi dati e lanciare una nuova partita?[s/N]" + +msgid "The latest version of Gameshell is available at" +msgstr "L'ultima versione di Gameshell é disponibile a" + +msgid "There are stopped jobs in your session.\n" + "Those processes will be terminated.\n" + "You can get the list of those jobs with\n" + " $ jobs\n" + "Do you still want to quit? [y/n]" +msgstr "Ci sono dei processi fermati nella tua sessione.\n" + "Questi processi verranno terminati.\n" + "Puoi ottenere la lista di questi processi con\n" + " $ jobs\n" + "Vuoi uscire lo stesso? [s/n\n" + "]" + +msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" + "You should use the command\n" + " $ gsh reset" +msgstr "Attenzione: il file 'treasure.sh' é stato caricato da una subshell.\n" + "Dovresti utilizzare il comando\n" + " $ gsh reset" + +msgid "Warning: this mission was initialized in a subshell.\n" + "Run the command\n" + " $ gsh reset\n" + "to make sure the mission is initialized properly." +msgstr "Attenzione: questa missione é stata avviato da una subshell.\n" + "Avvia il comando\n" + " $ gsh reset\n" + "per assicurarsi che la missione sia avviata correttamente." + +msgid "While you are waiting, a bat flies by..." +msgstr "Mentre tu stai aspettando, un pipistrello vola via..." + +msgid "While you are waiting, a caterpillar crawls by..." +msgstr "Mentre stai aspettando, un bruco striscia via..." + +msgid "While you are waiting, a centipede crawls by..." +msgstr "Mentre stai aspettando, un millipiede striscia via..." + +msgid "While you are waiting, a duck swims by..." +msgstr "Mentre stai aspettando, una papera nuota via..." + +msgid "While you are waiting, a fish swims by..." +msgstr "Mentre stai aspettando, un pesce nuota via..." + +msgid "While you are waiting, a large fish swims by..." +msgstr "Mentre stai aspettando, un grande pesce nuota via..." + +msgid "While you are waiting, a snail goes by..." +msgstr "Mentre stai aspettando, una lumaca va..." + +msgid "While you are waiting, a snake slithers by..." +msgstr "Mentre stai aspettando, un serpente svicola via..." + +msgid "While you are waiting, a spider crawls by..." +msgstr "Mentre stai aspettando, un ragno strisca via..." + +msgid "While you are waiting, an ant crawls by..." +msgstr "Mentre stai aspettando, una formica va via..." + +msgid "While you are waiting, you see a fish swimming in circles..." +msgstr "Mentre stai aspettando, vedi un pesce nuotare in cerchio..." + +msgid "Y" +msgstr "S" + +msgid "You left GameShell's directory structure. Use\n" + " $ cd\n" + "to go back to the GameShell's starting directory." +msgstr "Hai lasciato la struttura di cartelle di Gameshell . Usa\n" + " $ cd\n" + "per tornare indietro alla cartella iniziale di Gameshell." + +msgid "[Press space to continue, q to quit\\.]" +msgstr "[Premi invio per continuare, q per uscire\\.]" + +msgid "cancelled" +msgstr "annullato" + +msgid "completed" +msgstr "completato" + +msgid "days" +msgstr "giorni" + +msgid "failed" +msgstr "fallito" #, awk-format -msgid "game time: %s in %d session" -msgid_plural "game time: %s in %d sessions" -msgstr[0] "tempo di gioco: %s in %d sessione" -msgstr[1] "tempo di gioco: %s in %d sessioni" +msgid "game time: %s in %d session" +msgid_plural "game time: %s in %d sessions" +msgstr[0] "tempo di gioco: %s in %d sessione" +msgstr[1] "tempo di gioco: %s in %d sessioni" -msgid "n" -msgstr "n" +msgid "n" +msgstr "n" -msgid "password:" -msgstr "password:" +msgid "password:" +msgstr "password:" -msgid "skipped" -msgstr "saltate" +msgid "skipped" +msgstr "saltate" #, sh-format -msgid "test $nb_tests failed" -msgstr "test $nb_tests falliti" +msgid "test $nb_tests failed" +msgstr "test $nb_tests falliti" #, awk-format -msgid "total time: %s" -msgstr "tempo totale: %s" +msgid "total time: %s" +msgstr "tempo totale: %s" + +msgid "use 'gsh help' to get a list of available commands" +msgstr "" -msgid "y" -msgstr "s" +msgid "y" +msgstr "s" diff --git a/i18n/template.pot b/i18n/template.pot index 7f07b9852..27c23b462 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -277,5 +277,8 @@ msgstr "" msgid "total time: %s" msgstr "" +msgid "use 'gsh help' to get a list of available commands" +msgstr "" + msgid "y" msgstr "" diff --git a/lib/bashrc b/lib/bashrc index da95f8cd4..f5fa68b9d 100644 --- a/lib/bashrc +++ b/lib/bashrc @@ -25,3 +25,4 @@ complete -W 'check exit goal help index log reset resetstatic stat version welco # print message when player wanders outside GameShell filesystem PROMPT_COMMAND[0]=_check_pwd +PROMPT_COMMAND[1]=_help_hint diff --git a/lib/gsh.sh b/lib/gsh.sh index f369c04b2..5b6558450 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -298,6 +298,7 @@ to make sure the mission is initialized properly.")" >&2 else parchment -B Inverted "$(eval_gettext '$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt')" fi + [ "$GSH_HELP_HINT" = "never" ] || [ "$GSH_HELP_HINT" = "always" ] || GSH_HELP_HINT=0 fi } diff --git a/lib/gshrc b/lib/gshrc index 60f975896..845cd66ce 100644 --- a/lib/gshrc +++ b/lib/gshrc @@ -91,4 +91,18 @@ to go back to the GameShell's starting directory.")" >&2 esac } +# display a small message so players know how to get help about gameshell +_help_hint() { + [ -n "$GSH_QUIET_INTRO" ] || [ "$GSH_HELP_HINT" = "never" ] && return + + if [ "$GSH_HELP_HINT" != "always" ] && + { [ "$(gsh pcm)" -gt 3 ] || [ "$GSH_MODE" = "DEBUG" ] || [ "$GSH_HELP_HINT" = "0" ] ; } + then + unset GSH_HELP_HINT + return + fi + echo + echo "[$(gettext "use 'gsh help' to get a list of available commands")]" +} + [ "$GSH_MODE" != "DEBUG" ] && ! [ -d "$GSH_ROOT/.git" ] && gsh protect diff --git a/lib/zshrc b/lib/zshrc index 7cf72a85c..74c93c51d 100644 --- a/lib/zshrc +++ b/lib/zshrc @@ -45,4 +45,5 @@ compdef '[ "$CURRENT" -le 2 ] && _values : check exit goal help index log reset # print message when player wanders outside GameShell filesystem precmd() { _check_pwd + _help_hint } From 6a3e45d3e8b0e025974c43e7d1b3c96934a6d9f5 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 19:07:26 +0200 Subject: [PATCH 030/103] added optional alphabet argument to random_string --- scripts/random_string | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/random_string b/scripts/random_string index 3b363d16a..dd6891944 100755 --- a/scripts/random_string +++ b/scripts/random_string @@ -1,13 +1,18 @@ -#!/usr/bin/env sh +#!/bin/sh + +# usage +# random_string [N [ALPHABET]] +# GSH_ROOT="$(cd "$(dirname "$0")/.." && pwd -P)" GSH_CONFIG=$GSH_ROOT/.config n=$1 +alpha=$(echo "${2:-"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"}" | sed 's/./& /g') -awk -v n=${n:-32} -v seed_file="$GSH_CONFIG/PRNG_seed" -v PID=$$ 'BEGIN { +awk -v n=${n:-32} -v alpha="$alpha" -v seed_file="$GSH_CONFIG/PRNG_seed" -v PID=$$ 'BEGIN { getline seed < seed_file; if (seed) srand(seed); else srand(); - l = split("A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z", chars); + l = split(alpha, chars); for(i=0;i Date: Thu, 9 May 2024 11:47:56 +0200 Subject: [PATCH 031/103] bug when getting CLI arguments from self extracting archive --- lib/header.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/header.sh b/lib/header.sh index 37fee62a1..55b76a957 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -34,7 +34,7 @@ GSH_EXEC_DIR=$(cd "$GSH_EXEC_DIR"; pwd -P) # just in case GSH_EXEC_DIR=${GSH_EXEC_DIR:-.} -while getopts "VUXKFh" opt +while getopts "hnPdDACRXUVqGL:KBZc:FS:" opt do case "$opt" in V) From 1829cb3818ea5c9ca413df95e1d869aa6e5edc88 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 9 May 2024 17:14:11 +0200 Subject: [PATCH 032/103] better error message on invalid options --- lib/header.sh | 7 ++++++- start.sh | 23 ++++++++++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/lib/header.sh b/lib/header.sh index 55b76a957..db2613f82 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -34,7 +34,7 @@ GSH_EXEC_DIR=$(cd "$GSH_EXEC_DIR"; pwd -P) # just in case GSH_EXEC_DIR=${GSH_EXEC_DIR:-.} -while getopts "hnPdDACRXUVqGL:KBZc:FS:" opt +while getopts ":hnPdDACRXUVqGL:KBZc:FS:" opt do case "$opt" in V) @@ -89,6 +89,11 @@ do # used to avoid checking for more recent files GSH_HELP="true" ;; + '?') + echo "$0: invalid option '-$OPTARG'" >&2 + echo "use $0 -h to get the list of available options" >&2 + exit 1 + ;; *) # ignore other options, they will be passed to start.sh ;; diff --git a/start.sh b/start.sh index 9c9819059..ba55ddbb0 100755 --- a/start.sh +++ b/start.sh @@ -37,7 +37,7 @@ GSH_MODE="ANONYMOUS" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" -while getopts "hnPdDACRXUVqGL:KBZc:FS:" opt +while getopts ":hnPdDACRXUVqGL:KBZc:FS:" opt do case $opt in S) @@ -86,10 +86,6 @@ do G) export GSH_NO_GETTEXT=1 ;; - X | U) - echo "$(gettext "Error: this option is only available from an executable archive!")" >&2 - exit 1 - ;; V) # when lib/header.sh sees the -V flag, it displays the version and exits, # so the next case isn't used. @@ -111,17 +107,18 @@ do c) GSH_COMMAND=$OPTARG ;; - K|F) - : # used by the self-extracting archive - ;; - *) - if [ "$_long_option" = "1" ] - then - OPTARG="-$opt" - fi + '?') echo "$(eval_gettext "Error: invalid option: '-\$OPTARG'")" >&2 exit 1 ;; + X | U) + echo "$(gettext "Error: this option is only available from an executable archive!")" >&2 + exit 1 + ;; + *) + : # other options are used by the self-extracting archive and passed on + # we ignore them + ;; esac done shift $((OPTIND - 1)) From 9d02cb0c57829c35199fbfa839e0886b5d4f2058 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 9 May 2024 16:52:35 +0200 Subject: [PATCH 033/103] cleaning _gsh_save so that it works correctly when explicitly called --- lib/gsh.sh | 3 ++- scripts/_gsh_save | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/lib/gsh.sh b/lib/gsh.sh index 5b6558450..edc52a4e7 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -171,7 +171,8 @@ Do you still want to quit? [y/n]") " __gsh_clean "$MISSION_NB" [ "$GSH_MODE" != "DEBUG" ] && ! [ -d "$GSH_ROOT/.git" ] && gsh unprotect [ -e "$GSH_ROOT/.save" ] && __save - # remove the ".save" file to make sure we don't always save from now on! + # remove the ".save" file to make sure we don't automatically save if call + # start.sh directly from the directory rm -f "$GSH_ROOT/.save" ## NOTE: without that, calling exit in zsh doesn't work if there are running diff --git a/scripts/_gsh_save b/scripts/_gsh_save index b6cb6f393..7d9ebf779 100755 --- a/scripts/_gsh_save +++ b/scripts/_gsh_save @@ -18,12 +18,12 @@ then exit 2 fi -case "$(cd "$(dirname "$SAVEFILE")"; pwd -P)" in - "$GSH_ROOT"*) - echo "Error: the savefile cannot be inside GameShell directory structure." >&2 - exit 4 - ;; -esac +# case "$(cd "$(dirname "$SAVEFILE")"; pwd -P)" in +# "$GSH_ROOT"*) +# echo "Error: the savefile cannot be inside GameShell directory structure." >&2 +# exit 4 +# ;; +# esac if ! [ -r "$GSH_ROOT" ] @@ -41,14 +41,14 @@ fi GSH_LAST_CHECKED_MISSION=$(_gsh_plm) sed-i "s/^GSH_LAST_CHECKED_MISSION=.*/GSH_LAST_CHECKED_MISSION=$GSH_LAST_CHECKED_MISSION/" "$GSH_ROOT/lib/header.sh" -tar -zcf "$GSH_ROOT.tgz" -C "$GSH_EXEC_DIR" "$(basename "$GSH_ROOT")" +tar --exclude="$SAVEFILE.tgz" -zcf "$SAVEFILE.tgz" -C "$(dirname "$GSH_ROOT")" "$(basename "$GSH_ROOT")" ARCHIVE_OK=$? -cat "$GSH_ROOT/lib/header.sh" "$GSH_ROOT.tgz" > "$SAVEFILE" +cat "$GSH_ROOT/lib/header.sh" "$SAVEFILE.tgz" > "$SAVEFILE" SAVE_OK=$? chmod +x "$SAVEFILE" -rm -f "$GSH_ROOT.tgz" +rm --system -f "$SAVEFILE.tgz" if [ "$ARCHIVE_OK" -ne 0 ] || [ "$SAVE_OK" -ne 0 ] then From 700f662dd789c1bf0bad12048eae86e1aa96caf2 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 19:37:23 +0200 Subject: [PATCH 034/103] better handling of the .save file this file (in $GSH_ROOT) is used to control automatically saving on exit --- .gitignore | 1 + Makefile | 4 ++-- lib/header.sh | 5 +++++ start.sh | 3 --- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 6f431db9f..07cf065e2 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ TODO .sbin .config .tmp +.save World locale/ *~ diff --git a/Makefile b/Makefile index 90e09727e..7c4e3f49f 100644 --- a/Makefile +++ b/Makefile @@ -55,8 +55,8 @@ tests-zsh: clean ./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 42); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' clean: - rm -rf i18n/*~ locale gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk - rm -rf .bin .config .sbin .tmp World + rm -rf i18n/*~ locale gameshell gameshell.tar gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk + rm -rf .bin .config .sbin .tmp .save World rm -rf "game shell"* .PHONY: clean new FORCE diff --git a/lib/header.sh b/lib/header.sh index db2613f82..18384155b 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -160,6 +160,7 @@ NB_LINES=$(awk '/^##START_OF_GAMESHELL_ARCHIVE##/ {print NR + 1; exit 0; }' "$GS if [ "$GSH_EXTRACT" = "true" ] then + echo $NB_LINES tail -n+"$NB_LINES" "$GSH_EXEC_DIR/$GSH_EXEC_FILE" > "$GSH_EXEC_DIR/${GSH_EXEC_FILE%.*}.tgz" echo "Archive saved in $GSH_EXEC_DIR/${GSH_EXEC_FILE%.*}.tgz" exit 0 @@ -190,6 +191,10 @@ fi # and add a safeguard so we can check we are not removing another directory touch "$GSH_ROOT/.gsh_root-$$" +# add a .save file so that we save the directory into a self extracting archive +# when exiting +touch "$GSH_ROOT/.save" + tail -n+"$NB_LINES" "$GSH_EXEC_DIR/$GSH_EXEC_FILE" > "$GSH_ROOT/gameshell.tgz" tar -zx -C "$GSH_ROOT" -f "$GSH_ROOT/gameshell.tgz" rm "$GSH_ROOT/gameshell.tgz" diff --git a/start.sh b/start.sh index ba55ddbb0..7623831c6 100755 --- a/start.sh +++ b/start.sh @@ -506,9 +506,6 @@ cd "$GSH_HOME" export GSH_UID=$(cat "$GSH_CONFIG/uid") date "+%Y-%m-%d %H:%M:%S" | sed 's/^/#>>> /' >> "$GSH_CONFIG/missions.log" -# put a ".save" file to indicate the archive needs to be saved on exit -touch "$GSH_ROOT/.save" - # if the user uses a special TERMINFO entry, it might not be found because # GameShell redefines HOME if [ -z "$TERMINFO" ] From 746f72ed00a071f64211cc2b2048077adc1c8ee9 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 9 May 2024 23:01:35 +0200 Subject: [PATCH 035/103] missing translation for a error message --- i18n/en.po | 3 +++ i18n/fr.po | 3 +++ i18n/it.po | 3 +++ i18n/template.pot | 3 +++ 4 files changed, 12 insertions(+) diff --git a/i18n/en.po b/i18n/en.po index e275f687c..32486a1b9 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -118,6 +118,9 @@ msgid "Error: no mission was found!\n" msgstr "Error: no mission was found!\n" "Aborting." +msgid "Error: save mode can only be 'index', 'simple' or 'overwrite'" +msgstr "Error: save mode can only be 'index', 'simple' or 'overwrite'" + msgid "Error: the 'goto' command requires a mission number as argument." msgstr "Error: the 'goto' command requires a mission number as argument." diff --git a/i18n/fr.po b/i18n/fr.po index 716a2d225..9242ac71d 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -122,6 +122,9 @@ msgid "Error: no mission was found!\n" msgstr "Erreur : aucune mission trouvée !\n" "Abandon." +msgid "Error: save mode can only be 'index', 'simple' or 'overwrite'" +msgstr "Erreur : le mode de sauvegarde ne peut être que 'index', 'simple' ou 'overwrite'" + msgid "Error: the 'goto' command requires a mission number as argument." msgstr "Erreur : la commande 'goto' a besoin d'un numéro de mission en argument." diff --git a/i18n/it.po b/i18n/it.po index 57da53e26..548a4ae57 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -132,6 +132,9 @@ msgid "Error: no mission was found!\n" msgstr "Errore: nessuna missione trovata!\n" "Interruzione!" +msgid "Error: save mode can only be 'index', 'simple' or 'overwrite'" +msgstr "" + msgid "Error: the 'goto' command requires a mission number as argument." msgstr "Errore: il comando 'goto' richiede un numero di missione come argomento.`" diff --git a/i18n/template.pot b/i18n/template.pot index 27c23b462..dd66df7b9 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -115,6 +115,9 @@ msgid "Error: no mission was found!\n" "Aborting." msgstr "" +msgid "Error: save mode can only be 'index', 'simple' or 'overwrite'" +msgstr "" + msgid "Error: the 'goto' command requires a mission number as argument." msgstr "" From 82bd7043acc0fff56d74d14e58eeff596b859d78 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 13 Aug 2024 19:25:43 +0200 Subject: [PATCH 036/103] 2 directory names / script names differed only in case which is a problem on case insensitive filesystems... --- i18n/en.po | 4 ++-- i18n/fr.po | 4 ++-- .../en.txt | 0 .../fr.txt | 0 .../it.txt | 0 i18n/it.po | 4 ++-- i18n/template.pot | 2 +- lib/gsh.sh | 19 +++++++++++++++++++ scripts/_gsh_HELP | 6 ------ scripts/_gsh_help | 6 ------ 10 files changed, 26 insertions(+), 19 deletions(-) rename i18n/{gameshell-HELP => gameshell-full-help}/en.txt (100%) rename i18n/{gameshell-HELP => gameshell-full-help}/fr.txt (100%) rename i18n/{gameshell-HELP => gameshell-full-help}/it.txt (100%) delete mode 100755 scripts/_gsh_HELP delete mode 100755 scripts/_gsh_help diff --git a/i18n/en.po b/i18n/en.po index 32486a1b9..5a673fcb4 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -1,7 +1,7 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-HELP/en.txt" +msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-full-help/en.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" diff --git a/i18n/fr.po b/i18n/fr.po index 9242ac71d..1f36739c6 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -4,8 +4,8 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n>1;\n" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-HELP/fr.txt" +msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-full-help/fr.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" diff --git a/i18n/gameshell-HELP/en.txt b/i18n/gameshell-full-help/en.txt similarity index 100% rename from i18n/gameshell-HELP/en.txt rename to i18n/gameshell-full-help/en.txt diff --git a/i18n/gameshell-HELP/fr.txt b/i18n/gameshell-full-help/fr.txt similarity index 100% rename from i18n/gameshell-HELP/fr.txt rename to i18n/gameshell-full-help/fr.txt diff --git a/i18n/gameshell-HELP/it.txt b/i18n/gameshell-full-help/it.txt similarity index 100% rename from i18n/gameshell-HELP/it.txt rename to i18n/gameshell-full-help/it.txt diff --git a/i18n/it.po b/i18n/it.po index 548a4ae57..aed99ffdf 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -14,8 +14,8 @@ msgstr "Project-Id-Version: \n" "X-Generator: Lokalize 22.04.1\n" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-HELP/it.txt" +msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gameshell-full-help/it.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" diff --git a/i18n/template.pot b/i18n/template.pot index dd66df7b9..0c0c03fc7 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -1,5 +1,5 @@ #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-HELP/en.txt" +msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" msgstr "" #, sh-format diff --git a/lib/gsh.sh b/lib/gsh.sh index edc52a4e7..69bd86fb8 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -639,6 +639,17 @@ _gsh_test() { } +### +# don't put the next 2 functions in $GSH_ROOT/scripts/_gsh_help / _gsh_HELP +# because it doesn't work on case insensitive filesystems +_gsh_help() { + parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-help/en.txt')" Parchment2 | pager +} + +_gsh_HELP() { + parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-full-help/en.txt')" Parchment2 | pager +} + gsh() { local _TEXTDOMAIN=$TEXTDOMAIN export TEXTDOMAIN="gsh" @@ -708,6 +719,14 @@ gsh() { __gsh_start "$@" ;; + "help") + _gsh_help + ;; + + "HELP") + _gsh_HELP + ;; + *) if command -v "_gsh_$cmd" >/dev/null then diff --git a/scripts/_gsh_HELP b/scripts/_gsh_HELP deleted file mode 100755 index 638672b52..000000000 --- a/scripts/_gsh_HELP +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -. gsh_gettext.sh - -parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-HELP/en.txt')" Parchment2 | pager - diff --git a/scripts/_gsh_help b/scripts/_gsh_help deleted file mode 100755 index d2ec695a7..000000000 --- a/scripts/_gsh_help +++ /dev/null @@ -1,6 +0,0 @@ -#!/usr/bin/env sh - -. gsh_gettext.sh - -parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-help/en.txt')" Parchment2 | pager - From 7b2fa74b29870cff8534734b458a03e4d4d03542 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 27 Aug 2024 16:20:09 +0200 Subject: [PATCH 037/103] the cal command is now in package "ncal" (Debian / Ubuntu) --- Dockerfile | 2 +- README-fr.md | 2 +- README-it.md | 2 +- README.md | 2 +- doc/deps.md | 4 ++-- missions/misc/01_cal_nostradamus/i18n/en.po | 4 ++-- missions/misc/01_cal_nostradamus/i18n/fr.po | 4 ++-- missions/misc/01_cal_nostradamus/i18n/it.po | 4 ++-- missions/misc/01_cal_nostradamus/i18n/template.pot | 2 +- missions/misc/01_cal_nostradamus/init.sh | 2 +- 10 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 2f6e1d7c3..e5d575f74 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN apt install --no-install-recommends --assume-yes \ procps \ nano \ tree \ - bsdmainutils \ + ncal \ x11-apps RUN apt clean RUN rm -rf /var/lib/apt/lists/* diff --git a/README-fr.md b/README-fr.md index 4a2983480..daee626d1 100644 --- a/README-fr.md +++ b/README-fr.md @@ -35,7 +35,7 @@ missions ont des dépendances additionnelles : elles seront annulées si leurs dépendances ne sont pas satisfaites. Sur Debian ou Ubuntu, lancez la commande suivante pour installer toutes les dépendances pour le jeu et les missions. ```sh -$ sudo apt install gettext-base man-db psmisc nano tree bsdmainutils x11-apps +$ sudo apt install gettext-base man-db psmisc nano tree ncal x11-apps ``` Consultez le [manuel utilisateur](doc/user_manual.md) (en anglais) pour voir comment installer les dépendances sur d'autres systèmes (macOS, BSD, ...). diff --git a/README-it.md b/README-it.md index 892d0544c..2a7141020 100644 --- a/README-it.md +++ b/README-it.md @@ -21,7 +21,7 @@ Come cominciare GameShell dovrebbe funzionare in qualunque sistema Linux standard, e anche su macOS e BSD (ma abbiamo eseguito pochi test su questi). Su Debian e Ubuntu, le uniche dipendenze (oltre `bash`) sono i pacchetti `gettext-base` e `awk`(questo di solito presente di default). Alcune missioni hanno dipendenze addizionali: queste missioni verranno saltate se le dipendenze non sono state risolte. Su Debian o Ubuntu, esegui i comandi seguenti per installare tutte le dipendenze del gioco e delle missioni. ```sh -$ sudo apt install gettext man-db procps psmisc nano tree bsdmainutils x11-apps wget +$ sudo apt install gettext man-db procps psmisc nano tree ncal x11-apps wget ``` Controlla il [manuale utente](doc/user_manual.md) per vedere come installare le dipendenze su altri sistemi (macOS, BSD, ...). diff --git a/README.md b/README.md index ae2504dcc..1fd3988ac 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ dependencies: these missions will be skipped if the dependencies are not met. On Debian or Ubuntu, run the following command to install all game and mission dependencies. ```sh -$ sudo apt install gettext man-db procps psmisc nano tree bsdmainutils x11-apps wget +$ sudo apt install gettext man-db procps psmisc nano tree ncal x11-apps wget ``` Check the [user manual](doc/user_manual.md) to see how to install the game dependencies on other systems (macOS, BSD, ...). diff --git a/doc/deps.md b/doc/deps.md index f0be0dd32..8a40de1b0 100644 --- a/doc/deps.md +++ b/doc/deps.md @@ -20,14 +20,14 @@ the following - `pstree` (`psmisc` package in Debian/Ubuntu) - `nano` (`nano` package in Debian/Ubuntu) - `tree` (`tree` package in Debian/Ubuntu) - - `cal` (`bsdmainutils` package in Debian/Ubuntu) + - `cal` (`ncal` package in Debian/Ubuntu) - `xeyes` (`x11-apps` package in Debian/Ubuntu) On a Debian / Ubuntu system, the following ensures you have everything you need to run GameShell without problems. ```sh -$ sudo apt install gettext-base man-db procps psmisc nano tree bsdmainutils x11-apps +$ sudo apt install gettext-base man-db procps psmisc nano tree ncal x11-apps ``` diff --git a/missions/misc/01_cal_nostradamus/i18n/en.po b/missions/misc/01_cal_nostradamus/i18n/en.po index 3181ecf15..75c2bf914 100644 --- a/missions/misc/01_cal_nostradamus/i18n/en.po +++ b/missions/misc/01_cal_nostradamus/i18n/en.po @@ -24,9 +24,9 @@ msgstr "That's not even a valid answer!" #, sh-format msgid "The command 'cal' is required for mission $MISSION_NAME.\n" - "(Debian / Ubuntu: install package 'bsdmainutils')" + "(Debian / Ubuntu: install package 'ncal')" msgstr "The command 'cal' is required for mission $MISSION_NAME.\n" - "(Debian / Ubuntu: install package 'bsdmainutils')" + "(Debian / Ubuntu: install package 'ncal')" #, sh-format msgid "What was the day of the week for the $MM-$DD-$YYYY?" diff --git a/missions/misc/01_cal_nostradamus/i18n/fr.po b/missions/misc/01_cal_nostradamus/i18n/fr.po index 136baf49a..780f0f2ef 100644 --- a/missions/misc/01_cal_nostradamus/i18n/fr.po +++ b/missions/misc/01_cal_nostradamus/i18n/fr.po @@ -23,9 +23,9 @@ msgstr "Ce n'est même pas une réponse valide !" #, sh-format msgid "The command 'cal' is required for mission $MISSION_NAME.\n" - "(Debian / Ubuntu: install package 'bsdmainutils')" + "(Debian / Ubuntu: install package 'ncal')" msgstr "La commande 'cal' est nécessaire pour la mission $MISSION_NAME.\n" - "(Debian / Ubuntu : installez le paquet 'bsdmainutils')" + "(Debian / Ubuntu : installez le paquet 'ncal')" #, sh-format msgid "What was the day of the week for the $MM-$DD-$YYYY?" diff --git a/missions/misc/01_cal_nostradamus/i18n/it.po b/missions/misc/01_cal_nostradamus/i18n/it.po index 0c6255dfe..ffb6e1623 100644 --- a/missions/misc/01_cal_nostradamus/i18n/it.po +++ b/missions/misc/01_cal_nostradamus/i18n/it.po @@ -35,10 +35,10 @@ msgstr "Non é una risposta valida!" #, sh-format msgid "" "The command 'cal' is required for mission $MISSION_NAME.\n" -"(Debian / Ubuntu: install package 'bsdmainutils')" +"(Debian / Ubuntu: install package 'ncal')" msgstr "" "Il comando 'cal' é richiesto per la missione $MISSION_NAME.\n " -"(Debian / Ubuntu: installa il pacchetto 'bsdmainutils')" +"(Debian / Ubuntu: installa il pacchetto 'ncal')" #, sh-format msgid "What was the day of the week for the $MM-$DD-$YYYY?" diff --git a/missions/misc/01_cal_nostradamus/i18n/template.pot b/missions/misc/01_cal_nostradamus/i18n/template.pot index f164cbad9..f13067b97 100644 --- a/missions/misc/01_cal_nostradamus/i18n/template.pot +++ b/missions/misc/01_cal_nostradamus/i18n/template.pot @@ -23,7 +23,7 @@ msgstr "" #, sh-format msgid "The command 'cal' is required for mission $MISSION_NAME.\n" - "(Debian / Ubuntu: install package 'bsdmainutils')" + "(Debian / Ubuntu: install package 'ncal')" msgstr "" #, sh-format diff --git a/missions/misc/01_cal_nostradamus/init.sh b/missions/misc/01_cal_nostradamus/init.sh index 7eaf1cd87..30bb43e3a 100644 --- a/missions/misc/01_cal_nostradamus/init.sh +++ b/missions/misc/01_cal_nostradamus/init.sh @@ -3,7 +3,7 @@ _mission_init() ( if ! command -v cal >/dev/null; then echo "$(eval_gettext "The command 'cal' is required for mission \$MISSION_NAME. -(Debian / Ubuntu: install package 'bsdmainutils')")" >&2 +(Debian / Ubuntu: install package 'ncal')")" >&2 return 1 fi # keep the date between 1902 and 2038 to avoid problems with 32bits systems From 4fe0d55f63f53561f1da19749ffd78c9d42009ee Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 7 May 2024 21:46:25 +0200 Subject: [PATCH 038/103] first version of a "control-C" mission --- missions/index.txt | 1 + missions/intermediate/05_control-C/Makefile | 41 +++++++++ .../05_control-C/ascii-art/explosion.txt | 13 +++ .../05_control-C/ascii-art/fireworks.txt | 11 +++ missions/intermediate/05_control-C/auto.sh | 24 ++++++ .../intermediate/05_control-C/charmiglio.sh | 85 +++++++++++++++++++ missions/intermediate/05_control-C/check.sh | 24 ++++++ missions/intermediate/05_control-C/clean.sh | 3 + missions/intermediate/05_control-C/goal.sh | 5 ++ .../intermediate/05_control-C/goal/en.txt | 26 ++++++ .../intermediate/05_control-C/goal/fr.txt | 27 ++++++ missions/intermediate/05_control-C/i18n/en.po | 38 +++++++++ .../05_control-C/i18n/template.pot | 36 ++++++++ missions/intermediate/05_control-C/init.sh | 10 +++ missions/intermediate/05_control-C/test.sh | 34 ++++++++ missions/intermediate/index.txt | 1 + 16 files changed, 379 insertions(+) create mode 100644 missions/intermediate/05_control-C/Makefile create mode 100644 missions/intermediate/05_control-C/ascii-art/explosion.txt create mode 100644 missions/intermediate/05_control-C/ascii-art/fireworks.txt create mode 100644 missions/intermediate/05_control-C/auto.sh create mode 100644 missions/intermediate/05_control-C/charmiglio.sh create mode 100644 missions/intermediate/05_control-C/check.sh create mode 100644 missions/intermediate/05_control-C/clean.sh create mode 100644 missions/intermediate/05_control-C/goal.sh create mode 100644 missions/intermediate/05_control-C/goal/en.txt create mode 100644 missions/intermediate/05_control-C/goal/fr.txt create mode 100644 missions/intermediate/05_control-C/i18n/en.po create mode 100644 missions/intermediate/05_control-C/i18n/template.pot create mode 100644 missions/intermediate/05_control-C/init.sh create mode 100644 missions/intermediate/05_control-C/test.sh diff --git a/missions/index.txt b/missions/index.txt index c9305d442..bf8394f59 100644 --- a/missions/index.txt +++ b/missions/index.txt @@ -5,6 +5,7 @@ misc/02_nano_journal intermediate/02_alias_journal intermediate/03_tab_spider_lair intermediate/04_bg_xeyes +intermediate/05_control-C !finding_files_maze/00_shared finding_files_maze/01_ls_cd finding_files_maze/02_tree diff --git a/missions/intermediate/05_control-C/Makefile b/missions/intermediate/05_control-C/Makefile new file mode 100644 index 000000000..bd85007b1 --- /dev/null +++ b/missions/intermediate/05_control-C/Makefile @@ -0,0 +1,41 @@ +SH_FILES=$(wildcard *.sh) +EXCEPTIONS= +OTHER_FILES= + +LANGUAGES=$(wildcard i18n/*.po) +LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) +SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) +SORT=--sort-output +OPTIONS=--indent --no-wrap --no-location + +all: i18n/en.po $(LANGUAGES) + +add-locations: SORT=--add-location --sort-by-file +add-locations: all + +i18n/en.po: i18n/template.pot FORCE + @echo "msgen $@" + @msgen $(OPTIONS) $(SORT) i18n/template.pot --output=$@ + @echo "# AUTOMATICALLY GENERATED -- DO NOT EDIT" | cat - $@ > $@~ + @mv $@~ $@ + +$(LANGUAGES):%.po: i18n/template.pot FORCE + @echo "msgmerge $@" + @msgmerge --update $(OPTIONS) $(SORT) $@ i18n/template.pot + +i18n/template.pot: $(SH_FILES) $(OTHER_FILES) FORCE + @mkdir -p i18n/ + @echo "generating i18n/template.pot" + @xgettext --from-code=UTF-8 --omit-header $(OPTIONS) $(SORT) --join-existing --output i18n/template.pot $(SH_FILES) $(OTHER_FILES) + @echo "done" + +new: i18n/template.pot + @read -p "language code: " lang; \ + [ -e "./i18n/$$lang.po" ] && echo "file i18n/$$lang.po already exists" && exit; \ + echo "file i18n/$$lang.po created"; \ + msgcat $(OPTIONS) --output i18n/$$lang.po i18n/template.pot + +clean: + rm -f i18n/*~ + +.PHONY: all clean new FORCE diff --git a/missions/intermediate/05_control-C/ascii-art/explosion.txt b/missions/intermediate/05_control-C/ascii-art/explosion.txt new file mode 100644 index 000000000..99832ccc4 --- /dev/null +++ b/missions/intermediate/05_control-C/ascii-art/explosion.txt @@ -0,0 +1,13 @@ + + _.-^^---....,,-- + _-- --_ + < >) + | | + \._ _./ + ```--. . , ; .--''' + | | | + .-=|| | |=-. + `-=#$%&%$#=-' + | ; :| + _____.,-#%&$@%#&#~,._____ + diff --git a/missions/intermediate/05_control-C/ascii-art/fireworks.txt b/missions/intermediate/05_control-C/ascii-art/fireworks.txt new file mode 100644 index 000000000..1fd24bceb --- /dev/null +++ b/missions/intermediate/05_control-C/ascii-art/fireworks.txt @@ -0,0 +1,11 @@ + + .''. + .''. . *''* :_\/_: . + :_\/_: _\(/_ .:.*_\/_* : /\ : .'.:.'. + .''.: /\ : ./)\ ':'* /\ * : '..'. -=:o:=- + :_\/_:'.:::. ' *''* * '.\'/.' _\(/_'.':'.' + : /\ : ::::: *_\/_* -= o =- /)\ ' * + '..' ':::' * /\ * .'/.\'. ' + * *..* : + * + * diff --git a/missions/intermediate/05_control-C/auto.sh b/missions/intermediate/05_control-C/auto.sh new file mode 100644 index 000000000..4dc721f7e --- /dev/null +++ b/missions/intermediate/05_control-C/auto.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +set -m + +for _ in $(seq 6) +do + eval "$(gettext charmiglio)" 2>/dev/null & + PID=$! + sleep 3 + kill -s INT "-$PID" 2> /dev/null + + case "$(cat "$GSH_TMP/control-C")" in + *[!0-9]*) + break + ;; + *) + : + ;; + esac +done + +gsh check < "$GSH_TMP/control-C" + + diff --git a/missions/intermediate/05_control-C/charmiglio.sh b/missions/intermediate/05_control-C/charmiglio.sh new file mode 100644 index 000000000..0529e2673 --- /dev/null +++ b/missions/intermediate/05_control-C/charmiglio.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env sh + +. gsh_gettext.sh + +control_c_start() { + [ -f "$GSH_TMP/control-C" ] || exit 255 + n=$(cat "$GSH_TMP/control-C") + case "$n" in + "" | *[!0-9]* ) + echo + echo + echo "$(eval_gettext 'Found it! The special incantion is $n')" + ;; + *) + echo + echo + echo "$(gettext "Don't interrupt me when I'm in a trance!!!")" + ;; + esac + exit 1 +} + +control_c_end() { + [ -f "$GSH_TMP/control-C" ] || exit 255 + n=$(cat "$GSH_TMP/control-C") + case "$n" in + "" | *[!0-9]* ) + echo + echo + echo "$(eval_gettext 'Found it! The special incantion is $n')" + ;; + *) + echo "$((n-1))" > "$GSH_TMP/control-C" + echo + echo + echo "$(gettext "Sorry, I fell asleep... Let's try again.")" + ;; + esac + exit 1 +} + +mumble() { + seconds=$1 + now=$(date +%s) + + while [ "$(($(date +%s) - now))" -le "$seconds" ] + do + printf "$(gettext "Merlin mumbles ")" >&2 + random_string "$((8 + $(RANDOM)%42))" | tr "A-Z" " " >&2 + sleep 0.1 + done +} + +check() { + [ -f "$GSH_TMP/control-C" ] || exit 255 + n=$(cat "$GSH_TMP/control-C") + case "$n" in + "" | *[!0-9]* ) + # we already know the solution + echo + echo "$(eval_gettext 'Found it! The special incantation is $n')" + exit 0 + ;; + *) + if [ "$n" -le 0 ] + then + # if we've finished, print the solution and save it + n=$(random_string 5) + echo "$n" > "$GSH_TMP/control-C" + echo + echo "$(eval_gettext 'Found it! The special incantation is $n')" + exit 0 + fi + esac +} + +trap 'control_c_start' INT +mumble 2 # mumble for 2 second +check +trap 'control_c_end' INT +mumble 120 # mumble for 2 minutes +echo +echo "$(gettext "Sorry, I fell asleep... Let's try again.")" + +echo "$(gettext "NOTE: you need to interrupt Merlin before he wakes up.")" diff --git a/missions/intermediate/05_control-C/check.sh b/missions/intermediate/05_control-C/check.sh new file mode 100644 index 000000000..f70584c0f --- /dev/null +++ b/missions/intermediate/05_control-C/check.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +_mission_check() { + r=$(cat "$GSH_TMP/control-C") + printf "%s " "$(gettext "What's the fireworks incantation?")" + read -r n + + case "$r" in + "" | *[!0-9]*) + if [ "$n" = "$r" ] + then + cat "$MISSION_DIR/ascii-art/fireworks.txt" + return 0 + else + cat "$MISSION_DIR/ascii-art/explosion.txt" + return 1 + fi + ;; + *) + cat "$MISSION_DIR/ascii-art/explosion.txt" + return 1 + esac +} +_mission_check diff --git a/missions/intermediate/05_control-C/clean.sh b/missions/intermediate/05_control-C/clean.sh new file mode 100644 index 000000000..f230756ac --- /dev/null +++ b/missions/intermediate/05_control-C/clean.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +rm -f "$GSH_TMP/control-C" diff --git a/missions/intermediate/05_control-C/goal.sh b/missions/intermediate/05_control-C/goal.sh new file mode 100644 index 000000000..96b1d9582 --- /dev/null +++ b/missions/intermediate/05_control-C/goal.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +command="$(gettext 'charmiglio')" +sed "s/\\\$command/$command/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" +unset command diff --git a/missions/intermediate/05_control-C/goal/en.txt b/missions/intermediate/05_control-C/goal/en.txt new file mode 100644 index 000000000..b834af72f --- /dev/null +++ b/missions/intermediate/05_control-C/goal/en.txt @@ -0,0 +1,26 @@ +Mission goal +============ + +The wizard Merlin appears next to you and asks for your help. +You need to whisper the magic word + $ $command +to put him into a trance so that he can remember a special +incantation for creating fireworks. + +The only problem is that after a couple of seconds in a trance, +Merlin falls asleep! You thus need to interrupt him whenever +that's the case, so that he can try again. + + +NOTE: it will probably take several tries before Merlin +actually remembers the incantation + + +Useful commands +=============== + +$command + this (non standard) command puts Merlin into a trance + +Control-c (also written ^c) + pressing Control and c at the same times interrupts the current command diff --git a/missions/intermediate/05_control-C/goal/fr.txt b/missions/intermediate/05_control-C/goal/fr.txt new file mode 100644 index 000000000..cc52acfae --- /dev/null +++ b/missions/intermediate/05_control-C/goal/fr.txt @@ -0,0 +1,27 @@ +Objectif +========= + +Le sorcier Merlin apparait à vos cotés et vous demande de +l'aide. Vous devez murmurer le mot magique + $ $command +pour le mettre dans une transe qui devrait lui permettre de +se souvenir d'une incantation spéciale pour créer des feux +d'artifice. + +Le seul problème est qu'après quelques secondes en trance, +Merlin s'endort ! Vous devez donc l'interrompre dans ce cas +pour qu'il puisse ré-essayer. + + +NOTE: il faudra probablement plusieurs essais pour que +Merlin retrouve son incantation. + + +Commandes utiles +================ + +$command + cette commande (non standard) met Merlin dans une transe + +Contrôle-c (aussi noté ^c) + appuyer sur les touches Contrôle et c en même temps interrompt la commande en cours diff --git a/missions/intermediate/05_control-C/i18n/en.po b/missions/intermediate/05_control-C/i18n/en.po new file mode 100644 index 000000000..a964d708c --- /dev/null +++ b/missions/intermediate/05_control-C/i18n/en.po @@ -0,0 +1,38 @@ +# AUTOMATICALLY GENERATED -- DO NOT EDIT +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/en.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/en.txt" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/en.txt" + +#, sh-format +msgid "FOUND: $n" +msgstr "FOUND: $n" + +msgid "Let me think a little more!!!" +msgstr "Let me think a little more!!!" + +msgid "What's the magic word?" +msgstr "What's the magic word?" + +msgid "You need to interrupt Merlin before he falls asleep.\n" + "Refer to the goal for details." +msgstr "You need to interrupt Merlin before he falls asleep.\n" + "Refer to the goal for details." + +msgid "You're right, that's not working" +msgstr "You're right, that's not working" + +msgid "charmiglio" +msgstr "charmiglio" diff --git a/missions/intermediate/05_control-C/i18n/template.pot b/missions/intermediate/05_control-C/i18n/template.pot new file mode 100644 index 000000000..9d8c81d8e --- /dev/null +++ b/missions/intermediate/05_control-C/i18n/template.pot @@ -0,0 +1,36 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +#, sh-format +msgid "FOUND: $n" +msgstr "" + +msgid "Let me think a little more!!!" +msgstr "" + +msgid "What's the magic word?" +msgstr "" + +msgid "You need to interrupt Merlin before he falls asleep.\n" + "Refer to the goal for details." +msgstr "" + +msgid "You're right, that's not working" +msgstr "" + +msgid "charmiglio" +msgstr "" diff --git a/missions/intermediate/05_control-C/init.sh b/missions/intermediate/05_control-C/init.sh new file mode 100644 index 000000000..5ac2aadfa --- /dev/null +++ b/missions/intermediate/05_control-C/init.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +_mission_init() { + # nb of tries to make + echo $((3 + $(RANDOM) % 3)) > "$GSH_TMP/control-C" + + cp "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" + chmod +x "$GSH_BIN/$(gettext charmiglio)" +} +_mission_init diff --git a/missions/intermediate/05_control-C/test.sh b/missions/intermediate/05_control-C/test.sh new file mode 100644 index 000000000..f47c342e8 --- /dev/null +++ b/missions/intermediate/05_control-C/test.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env sh + +set -m + +do_test() { + nb=$1 + delay=$2 + + for _ in $(seq "$nb") + do + eval "$(gettext charmiglio)" 2>/dev/null & + PID=$! + sleep "$delay" + kill -s INT "-$PID" 2> /dev/null + + case "$(cat "$GSH_TMP/control-C")" in + *[!0-9]*) + break + ;; + *) + : + ;; + esac + done +} + +do_test 10 0.3 +gsh assert check false < "$GSH_TMP/control-C" + +do_test 3 3 +gsh assert check false < "$GSH_TMP/control-C" + +do_test 6 3 +gsh assert check true < "$GSH_TMP/control-C" diff --git a/missions/intermediate/index.txt b/missions/intermediate/index.txt index 0ffc136de..9bca21db2 100644 --- a/missions/intermediate/index.txt +++ b/missions/intermediate/index.txt @@ -2,3 +2,4 @@ 02_alias_journal 03_tab_spider_lair 04_bg_xeyes +05_control-C From 36f74ca5d0f2e86bed334eeea6956256b33f9330 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 02:35:29 +0200 Subject: [PATCH 039/103] minor work on control-C mission --- .../intermediate/05_control-C/goal/en.txt | 6 +++-- .../intermediate/05_control-C/goal/fr.txt | 4 +++- missions/intermediate/05_control-C/i18n/en.po | 23 +++++++++++++++++++ .../05_control-C/i18n/template.pot | 23 +++++++++++++++++++ 4 files changed, 53 insertions(+), 3 deletions(-) diff --git a/missions/intermediate/05_control-C/goal/en.txt b/missions/intermediate/05_control-C/goal/en.txt index b834af72f..506b30730 100644 --- a/missions/intermediate/05_control-C/goal/en.txt +++ b/missions/intermediate/05_control-C/goal/en.txt @@ -20,7 +20,9 @@ Useful commands =============== $command - this (non standard) command puts Merlin into a trance + this (non standard) command puts Merlin into a trance Control-c (also written ^c) - pressing Control and c at the same times interrupts the current command + pressing Control and c at the same times interrupts the current command + by sending the INT ("INTerrupt") signal to the process + diff --git a/missions/intermediate/05_control-C/goal/fr.txt b/missions/intermediate/05_control-C/goal/fr.txt index cc52acfae..25c2369a1 100644 --- a/missions/intermediate/05_control-C/goal/fr.txt +++ b/missions/intermediate/05_control-C/goal/fr.txt @@ -24,4 +24,6 @@ $command cette commande (non standard) met Merlin dans une transe Contrôle-c (aussi noté ^c) - appuyer sur les touches Contrôle et c en même temps interrompt la commande en cours + appuyer sur les touches Contrôle et c en même temps interrompt + la commande en cours en envoyant le signal INT ("INTerrupt") au + processus diff --git a/missions/intermediate/05_control-C/i18n/en.po b/missions/intermediate/05_control-C/i18n/en.po index a964d708c..6a29a5a53 100644 --- a/missions/intermediate/05_control-C/i18n/en.po +++ b/missions/intermediate/05_control-C/i18n/en.po @@ -16,13 +16,36 @@ msgstr "$MISSION_DIR/skip/en.txt" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/en.txt" +msgid "Don't interrupt me when I'm in a trance!!!" +msgstr "Don't interrupt me when I'm in a trance!!!" + #, sh-format msgid "FOUND: $n" msgstr "FOUND: $n" +#, sh-format +msgid "Found it! The special incantation is $n" +msgstr "Found it! The special incantation is $n" + +#, sh-format +msgid "Found it! The special incantion is $n" +msgstr "Found it! The special incantion is $n" + msgid "Let me think a little more!!!" msgstr "Let me think a little more!!!" +msgid "Merlin mumbles " +msgstr "Merlin mumbles " + +msgid "NOTE: you need to interrupt Merlin before he wakes up." +msgstr "NOTE: you need to interrupt Merlin before he wakes up." + +msgid "Sorry, I fell asleep... Let's try again." +msgstr "Sorry, I fell asleep... Let's try again." + +msgid "What's the fireworks incantation?" +msgstr "What's the fireworks incantation?" + msgid "What's the magic word?" msgstr "What's the magic word?" diff --git a/missions/intermediate/05_control-C/i18n/template.pot b/missions/intermediate/05_control-C/i18n/template.pot index 9d8c81d8e..cb150a01a 100644 --- a/missions/intermediate/05_control-C/i18n/template.pot +++ b/missions/intermediate/05_control-C/i18n/template.pot @@ -15,13 +15,36 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" +msgid "Don't interrupt me when I'm in a trance!!!" +msgstr "" + #, sh-format msgid "FOUND: $n" msgstr "" +#, sh-format +msgid "Found it! The special incantation is $n" +msgstr "" + +#, sh-format +msgid "Found it! The special incantion is $n" +msgstr "" + msgid "Let me think a little more!!!" msgstr "" +msgid "Merlin mumbles " +msgstr "" + +msgid "NOTE: you need to interrupt Merlin before he wakes up." +msgstr "" + +msgid "Sorry, I fell asleep... Let's try again." +msgstr "" + +msgid "What's the fireworks incantation?" +msgstr "" + msgid "What's the magic word?" msgstr "" From d3009359a3f938c17640edeb2e90622426c8fe6d Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 11:35:58 +0200 Subject: [PATCH 040/103] add '.' characters when Merlin is falling asleep --- .../intermediate/05_control-C/charmiglio.sh | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/missions/intermediate/05_control-C/charmiglio.sh b/missions/intermediate/05_control-C/charmiglio.sh index 0529e2673..723531837 100644 --- a/missions/intermediate/05_control-C/charmiglio.sh +++ b/missions/intermediate/05_control-C/charmiglio.sh @@ -40,13 +40,24 @@ control_c_end() { } mumble() { - seconds=$1 - now=$(date +%s) + seconds=$1 # how long to mumble randomly (real time will be between $seconds and $seconds+1 + sleep=$2 # should '.' characters appears as times passes - while [ "$(($(date +%s) - now))" -le "$seconds" ] + now=$(date +%s) + d=0 + while [ "$d" -le "$seconds" ] do + d=$(($(date +%s) - now)) printf "$(gettext "Merlin mumbles ")" >&2 - random_string "$((8 + $(RANDOM)%42))" | tr "A-Z" " " >&2 + if [ "$sleep" ] + then + # generate a string of length 26 containing more and more '.' characters + i=$((d*2)) + alpha=$(echo "xnyjqmiwkgbplvadrhfuotcsez.........................." | awk "{print substr(\$0, $i<27?$i:27, 26)}" ) + else + alpha="a-z" + fi + random_string "$((8 + $(RANDOM)%42))" | tr "a-zA-Z" "$alpha " >&2 sleep 0.1 done } @@ -78,7 +89,7 @@ trap 'control_c_start' INT mumble 2 # mumble for 2 second check trap 'control_c_end' INT -mumble 120 # mumble for 2 minutes +mumble 120 sleep # mumble for 2 minutes, falling to sleep echo echo "$(gettext "Sorry, I fell asleep... Let's try again.")" From 7785859ae9597f10fef505d1d5e9f68da3cdb271 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 8 May 2024 15:02:59 +0200 Subject: [PATCH 041/103] French translations for control-C --- .../intermediate/05_control-C/charmiglio.sh | 8 ++-- .../intermediate/05_control-C/goal/fr.txt | 2 +- missions/intermediate/05_control-C/i18n/en.po | 22 ---------- missions/intermediate/05_control-C/i18n/fr.po | 42 +++++++++++++++++++ missions/intermediate/05_control-C/i18n/it.po | 38 +++++++++++++++++ .../05_control-C/i18n/template.pot | 21 ---------- missions/intermediate/05_control-C/init.sh | 3 +- 7 files changed, 86 insertions(+), 50 deletions(-) mode change 100644 => 100755 missions/intermediate/05_control-C/charmiglio.sh create mode 100644 missions/intermediate/05_control-C/i18n/fr.po create mode 100644 missions/intermediate/05_control-C/i18n/it.po diff --git a/missions/intermediate/05_control-C/charmiglio.sh b/missions/intermediate/05_control-C/charmiglio.sh old mode 100644 new mode 100755 index 723531837..c1583a163 --- a/missions/intermediate/05_control-C/charmiglio.sh +++ b/missions/intermediate/05_control-C/charmiglio.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env sh +#!/bin/sh . gsh_gettext.sh @@ -9,7 +9,7 @@ control_c_start() { "" | *[!0-9]* ) echo echo - echo "$(eval_gettext 'Found it! The special incantion is $n')" + echo "$(eval_gettext 'Found it! The special incantation is $n')" ;; *) echo @@ -27,7 +27,7 @@ control_c_end() { "" | *[!0-9]* ) echo echo - echo "$(eval_gettext 'Found it! The special incantion is $n')" + echo "$(eval_gettext 'Found it! The special incantation is $n')" ;; *) echo "$((n-1))" > "$GSH_TMP/control-C" @@ -47,7 +47,7 @@ mumble() { d=0 while [ "$d" -le "$seconds" ] do - d=$(($(date +%s) - now)) + d=$(($(date +%s) - now + 1)) printf "$(gettext "Merlin mumbles ")" >&2 if [ "$sleep" ] then diff --git a/missions/intermediate/05_control-C/goal/fr.txt b/missions/intermediate/05_control-C/goal/fr.txt index 25c2369a1..18b6e95ac 100644 --- a/missions/intermediate/05_control-C/goal/fr.txt +++ b/missions/intermediate/05_control-C/goal/fr.txt @@ -8,7 +8,7 @@ pour le mettre dans une transe qui devrait lui permettre de se souvenir d'une incantation spéciale pour créer des feux d'artifice. -Le seul problème est qu'après quelques secondes en trance, +Le seul problème est qu'après quelques secondes en transe, Merlin s'endort ! Vous devez donc l'interrompre dans ce cas pour qu'il puisse ré-essayer. diff --git a/missions/intermediate/05_control-C/i18n/en.po b/missions/intermediate/05_control-C/i18n/en.po index 6a29a5a53..f0ed9f4db 100644 --- a/missions/intermediate/05_control-C/i18n/en.po +++ b/missions/intermediate/05_control-C/i18n/en.po @@ -19,21 +19,10 @@ msgstr "$MISSION_DIR/treasure-msg/en.txt" msgid "Don't interrupt me when I'm in a trance!!!" msgstr "Don't interrupt me when I'm in a trance!!!" -#, sh-format -msgid "FOUND: $n" -msgstr "FOUND: $n" - #, sh-format msgid "Found it! The special incantation is $n" msgstr "Found it! The special incantation is $n" -#, sh-format -msgid "Found it! The special incantion is $n" -msgstr "Found it! The special incantion is $n" - -msgid "Let me think a little more!!!" -msgstr "Let me think a little more!!!" - msgid "Merlin mumbles " msgstr "Merlin mumbles " @@ -46,16 +35,5 @@ msgstr "Sorry, I fell asleep... Let's try again." msgid "What's the fireworks incantation?" msgstr "What's the fireworks incantation?" -msgid "What's the magic word?" -msgstr "What's the magic word?" - -msgid "You need to interrupt Merlin before he falls asleep.\n" - "Refer to the goal for details." -msgstr "You need to interrupt Merlin before he falls asleep.\n" - "Refer to the goal for details." - -msgid "You're right, that's not working" -msgstr "You're right, that's not working" - msgid "charmiglio" msgstr "charmiglio" diff --git a/missions/intermediate/05_control-C/i18n/fr.po b/missions/intermediate/05_control-C/i18n/fr.po new file mode 100644 index 000000000..1101d7049 --- /dev/null +++ b/missions/intermediate/05_control-C/i18n/fr.po @@ -0,0 +1,42 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/fr.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +msgid "Don't interrupt me when I'm in a trance!!!" +msgstr "Ne m'interromps pas pendant ma transe !!!" + +#, sh-format +msgid "Found it! The special incantation is $n" +msgstr "Trouvé ! L'incantation spéciale est $n" + +msgid "Merlin mumbles " +msgstr "Merlin marmonne " + +msgid "NOTE: you need to interrupt Merlin before he wakes up." +msgstr "NOTE : vous devez interrompre Merlin avant son réveil." + +msgid "Sorry, I fell asleep... Let's try again." +msgstr "Désolé, je m'étais endormi... Essayons encore." + +msgid "What's the fireworks incantation?" +msgstr "Quelle est l'incantation pour les feux d'artifice ?" + +msgid "charmiglio" +msgstr "charmiglio" + +#, fuzzy, sh-format +#~ msgid "Found it! The special incantion is $n" +#~ msgstr "Trouvé ! L'incantation spéciale est $n" diff --git a/missions/intermediate/05_control-C/i18n/it.po b/missions/intermediate/05_control-C/i18n/it.po new file mode 100644 index 000000000..3f142971a --- /dev/null +++ b/missions/intermediate/05_control-C/i18n/it.po @@ -0,0 +1,38 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +msgid "Don't interrupt me when I'm in a trance!!!" +msgstr "" + +#, sh-format +msgid "Found it! The special incantation is $n" +msgstr "" + +msgid "Merlin mumbles " +msgstr "" + +msgid "NOTE: you need to interrupt Merlin before he wakes up." +msgstr "" + +msgid "Sorry, I fell asleep... Let's try again." +msgstr "" + +msgid "What's the fireworks incantation?" +msgstr "" + +msgid "charmiglio" +msgstr "" diff --git a/missions/intermediate/05_control-C/i18n/template.pot b/missions/intermediate/05_control-C/i18n/template.pot index cb150a01a..9d60e3bdd 100644 --- a/missions/intermediate/05_control-C/i18n/template.pot +++ b/missions/intermediate/05_control-C/i18n/template.pot @@ -18,21 +18,10 @@ msgstr "" msgid "Don't interrupt me when I'm in a trance!!!" msgstr "" -#, sh-format -msgid "FOUND: $n" -msgstr "" - #, sh-format msgid "Found it! The special incantation is $n" msgstr "" -#, sh-format -msgid "Found it! The special incantion is $n" -msgstr "" - -msgid "Let me think a little more!!!" -msgstr "" - msgid "Merlin mumbles " msgstr "" @@ -45,15 +34,5 @@ msgstr "" msgid "What's the fireworks incantation?" msgstr "" -msgid "What's the magic word?" -msgstr "" - -msgid "You need to interrupt Merlin before he falls asleep.\n" - "Refer to the goal for details." -msgstr "" - -msgid "You're right, that's not working" -msgstr "" - msgid "charmiglio" msgstr "" diff --git a/missions/intermediate/05_control-C/init.sh b/missions/intermediate/05_control-C/init.sh index 5ac2aadfa..ea16e3e90 100644 --- a/missions/intermediate/05_control-C/init.sh +++ b/missions/intermediate/05_control-C/init.sh @@ -4,7 +4,6 @@ _mission_init() { # nb of tries to make echo $((3 + $(RANDOM) % 3)) > "$GSH_TMP/control-C" - cp "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" - chmod +x "$GSH_BIN/$(gettext charmiglio)" + copy_bin "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" } _mission_init From e0ff64cd640f23e6e3a36231625e3ff038a8ae38 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 9 May 2024 21:48:27 +0200 Subject: [PATCH 042/103] better control-c mission --- missions/index.txt | 3 +- .../{05_control-C => 05_background}/Makefile | 0 .../intermediate/05_background/ascii-art/f1 | 3 + .../intermediate/05_background/ascii-art/f2 | 4 + .../intermediate/05_background/ascii-art/f3 | 4 + .../intermediate/05_background/ascii-art/f4 | 5 + .../intermediate/05_background/ascii-art/f5 | 5 + .../intermediate/05_background/ascii-art/f6 | 4 + missions/intermediate/05_background/auto.sh | 5 + .../intermediate/05_background/charmiglio.sh | 24 ++++ missions/intermediate/05_background/check.sh | 37 ++++++ .../{05_control-C => 05_background}/goal.sh | 0 .../intermediate/05_background/goal/en.txt | 28 ++++ .../intermediate/05_background/goal/fr.txt | 29 ++++ .../i18n/en.po | 25 ++-- .../intermediate/05_background/i18n/fr.po | 33 +++++ .../i18n/it.po | 30 ++--- .../i18n/template.pot | 17 +-- .../{05_control-C => 05_background}/init.sh | 3 - missions/intermediate/05_background/test.sh | 17 +++ missions/intermediate/05_control-C/auto.sh | 24 ---- .../intermediate/05_control-C/charmiglio.sh | 96 -------------- missions/intermediate/05_control-C/clean.sh | 3 - .../intermediate/05_control-C/goal/en.txt | 28 ---- .../intermediate/05_control-C/goal/fr.txt | 29 ---- missions/intermediate/05_control-C/i18n/fr.po | 42 ------ .../intermediate/06_control-C/Charmiglio.sh | 125 ++++++++++++++++++ missions/intermediate/06_control-C/Makefile | 41 ++++++ .../ascii-art/explosion.txt | 0 .../ascii-art/fireworks.txt | 0 missions/intermediate/06_control-C/auto.sh | 24 ++++ .../{05_control-C => 06_control-C}/check.sh | 10 +- missions/intermediate/06_control-C/clean.sh | 3 + missions/intermediate/06_control-C/goal.sh | 5 + .../intermediate/06_control-C/goal/en.txt | 36 +++++ .../intermediate/06_control-C/goal/fr.txt | 36 +++++ missions/intermediate/06_control-C/i18n/en.po | 49 +++++++ missions/intermediate/06_control-C/i18n/fr.po | 48 +++++++ missions/intermediate/06_control-C/i18n/it.po | 49 +++++++ .../06_control-C/i18n/template.pot | 47 +++++++ missions/intermediate/06_control-C/init.sh | 10 ++ .../{05_control-C => 06_control-C}/test.sh | 8 +- missions/intermediate/index.txt | 3 +- 43 files changed, 713 insertions(+), 279 deletions(-) rename missions/intermediate/{05_control-C => 05_background}/Makefile (100%) create mode 100644 missions/intermediate/05_background/ascii-art/f1 create mode 100644 missions/intermediate/05_background/ascii-art/f2 create mode 100644 missions/intermediate/05_background/ascii-art/f3 create mode 100644 missions/intermediate/05_background/ascii-art/f4 create mode 100644 missions/intermediate/05_background/ascii-art/f5 create mode 100644 missions/intermediate/05_background/ascii-art/f6 create mode 100644 missions/intermediate/05_background/auto.sh create mode 100755 missions/intermediate/05_background/charmiglio.sh create mode 100644 missions/intermediate/05_background/check.sh rename missions/intermediate/{05_control-C => 05_background}/goal.sh (100%) create mode 100644 missions/intermediate/05_background/goal/en.txt create mode 100644 missions/intermediate/05_background/goal/fr.txt rename missions/intermediate/{05_control-C => 05_background}/i18n/en.po (51%) create mode 100644 missions/intermediate/05_background/i18n/fr.po rename missions/intermediate/{05_control-C => 05_background}/i18n/it.po (50%) rename missions/intermediate/{05_control-C => 05_background}/i18n/template.pot (62%) rename missions/intermediate/{05_control-C => 05_background}/init.sh (61%) create mode 100644 missions/intermediate/05_background/test.sh delete mode 100644 missions/intermediate/05_control-C/auto.sh delete mode 100755 missions/intermediate/05_control-C/charmiglio.sh delete mode 100644 missions/intermediate/05_control-C/clean.sh delete mode 100644 missions/intermediate/05_control-C/goal/en.txt delete mode 100644 missions/intermediate/05_control-C/goal/fr.txt delete mode 100644 missions/intermediate/05_control-C/i18n/fr.po create mode 100755 missions/intermediate/06_control-C/Charmiglio.sh create mode 100644 missions/intermediate/06_control-C/Makefile rename missions/intermediate/{05_control-C => 06_control-C}/ascii-art/explosion.txt (100%) rename missions/intermediate/{05_control-C => 06_control-C}/ascii-art/fireworks.txt (100%) create mode 100644 missions/intermediate/06_control-C/auto.sh rename missions/intermediate/{05_control-C => 06_control-C}/check.sh (50%) create mode 100644 missions/intermediate/06_control-C/clean.sh create mode 100644 missions/intermediate/06_control-C/goal.sh create mode 100644 missions/intermediate/06_control-C/goal/en.txt create mode 100644 missions/intermediate/06_control-C/goal/fr.txt create mode 100644 missions/intermediate/06_control-C/i18n/en.po create mode 100644 missions/intermediate/06_control-C/i18n/fr.po create mode 100644 missions/intermediate/06_control-C/i18n/it.po create mode 100644 missions/intermediate/06_control-C/i18n/template.pot create mode 100644 missions/intermediate/06_control-C/init.sh rename missions/intermediate/{05_control-C => 06_control-C}/test.sh (74%) diff --git a/missions/index.txt b/missions/index.txt index bf8394f59..01cddc073 100644 --- a/missions/index.txt +++ b/missions/index.txt @@ -5,7 +5,8 @@ misc/02_nano_journal intermediate/02_alias_journal intermediate/03_tab_spider_lair intermediate/04_bg_xeyes -intermediate/05_control-C +intermediate/05_background +intermediate/06_control-C !finding_files_maze/00_shared finding_files_maze/01_ls_cd finding_files_maze/02_tree diff --git a/missions/intermediate/05_control-C/Makefile b/missions/intermediate/05_background/Makefile similarity index 100% rename from missions/intermediate/05_control-C/Makefile rename to missions/intermediate/05_background/Makefile diff --git a/missions/intermediate/05_background/ascii-art/f1 b/missions/intermediate/05_background/ascii-art/f1 new file mode 100644 index 000000000..4b3118b49 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f1 @@ -0,0 +1,3 @@ + .:::. + ::::: + ':::' diff --git a/missions/intermediate/05_background/ascii-art/f2 b/missions/intermediate/05_background/ascii-art/f2 new file mode 100644 index 000000000..40ea27994 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f2 @@ -0,0 +1,4 @@ + . + _\(/_ + ./)\ + ' diff --git a/missions/intermediate/05_background/ascii-art/f3 b/missions/intermediate/05_background/ascii-art/f3 new file mode 100644 index 000000000..784393d04 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f3 @@ -0,0 +1,4 @@ + *''* + *_\/_* + * /\ * + *..* diff --git a/missions/intermediate/05_background/ascii-art/f4 b/missions/intermediate/05_background/ascii-art/f4 new file mode 100644 index 000000000..ded7a9c41 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f4 @@ -0,0 +1,5 @@ + : +'.\'/.' +-= o =- +.'/.\'. + : diff --git a/missions/intermediate/05_background/ascii-art/f5 b/missions/intermediate/05_background/ascii-art/f5 new file mode 100644 index 000000000..c67317304 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f5 @@ -0,0 +1,5 @@ + . +.'.:.'. +-=:o:=- +'.':'.' + ' diff --git a/missions/intermediate/05_background/ascii-art/f6 b/missions/intermediate/05_background/ascii-art/f6 new file mode 100644 index 000000000..b3e976ec8 --- /dev/null +++ b/missions/intermediate/05_background/ascii-art/f6 @@ -0,0 +1,4 @@ + .''. + :_\/_: + : /\ : + '..' diff --git a/missions/intermediate/05_background/auto.sh b/missions/intermediate/05_background/auto.sh new file mode 100644 index 000000000..f9bb5b0cb --- /dev/null +++ b/missions/intermediate/05_background/auto.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +set -m + +charmiglio & charmiglio & charmiglio & gsh check diff --git a/missions/intermediate/05_background/charmiglio.sh b/missions/intermediate/05_background/charmiglio.sh new file mode 100755 index 000000000..a11a8b1a5 --- /dev/null +++ b/missions/intermediate/05_background/charmiglio.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +. gsh_gettext.sh + +command=$(gettext "charmiglio") + + +file="$MISSION_DIR/ascii-art/f$((1 + $(RANDOM)%6))" +indent=$(echo " " | head -c "$((4 * ($(RANDOM)%8)))") + +rm -f "$GSH_TMP/charmiglio.pids" +for i in $(seq $((5 + $(RANDOM)%10))) +do + echo "$indent *" + sleep 0.1 +done + +awk -v indent="$indent" '{print indent, $0}' < "$file" + +echo $$ >> "$GSH_TMP/charmiglio.pids" + +sleep 1 + +exit 0 diff --git a/missions/intermediate/05_background/check.sh b/missions/intermediate/05_background/check.sh new file mode 100644 index 000000000..1784da88b --- /dev/null +++ b/missions/intermediate/05_background/check.sh @@ -0,0 +1,37 @@ +#!/usr/bin/env sh + +command="$(gettext 'charmiglio')" + +PIDS=$GSH_TMP/charmiglio.pids + +_check() { + rm -f "$PIDS" + + echo "$(gettext "Let's have a look:")" + + sleep 2 + + if [ ! -f "$PIDS" ] + then + echo "$(gettext "Mmm... I didn't see anything.")" + return 1 + fi + + NB=$(cat "$PIDS" | wc -l) + cat $PIDS + echo "NB = '$NB'" + if [ "$NB" -ge 3 ] + then + echo "$(gettext "Great, that looked good!")" + return 0 + elif [ "$NB" -lt 3 ] + then + echo "$(eval_gettext "Mmm... I only saw \$NB fireworks. That's not enough.")" + return 1 + else + echo "you shouldn't see this!" + return 1 + fi +} + +_check diff --git a/missions/intermediate/05_control-C/goal.sh b/missions/intermediate/05_background/goal.sh similarity index 100% rename from missions/intermediate/05_control-C/goal.sh rename to missions/intermediate/05_background/goal.sh diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt new file mode 100644 index 000000000..fc02db191 --- /dev/null +++ b/missions/intermediate/05_background/goal/en.txt @@ -0,0 +1,28 @@ +Mission goal +============ + +The king's pyrotechnician appears next to you. He asks you to fire **at least +3 of them** so he can see them from far away. + +A single firework can be created with the magical word + + $command + + +Useful commands +=============== + +$command + this (non standard) command creates a single small firework + +COMMAND & + run the given command, but don't wait until it is finished to return + The command will run in the "background". + +COMMAND1 ; COMMAND2 ; ... ; COMMANDn + run the given commands one after the other + Each command is run when the previous one is finished. + +COMMAND1 & COMMAND2 & ... & COMMANDn + run the given commands "in parallel" + All the commands are run in the "background", except the last one. diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt new file mode 100644 index 000000000..7244ff094 --- /dev/null +++ b/missions/intermediate/05_background/goal/fr.txt @@ -0,0 +1,29 @@ +Objectif +========= + +L'artificier royal apparait à vos cotés. Il vous demande de tirer **au moins 3 +jeux d'artifices" pour qu'il puisse les voir de loin. + +Une fusée simple peut être lancée avec le mot magique + + $command + + +Commandes utiles +================ + +$command + cette commande (non standard) lance un feu d'artifice simple + +COMMANDE & + exécute la commande mais n'attend pas qu'elle soit terminée pour reprendre + l'exécution du shell + La commande s'exécute "en arrière plan". + +COMMAND1 ; COMMAND2 ; ... ; COMMANDn + exécute les commandes données, l'une après l'autre + Chaque commande est exécutée lorsque la précédente est terminée. + +COMMAND1 & COMMAND2 & ... & COMMANDn + exécute les commandes données, "en parallèle" + Toutes les commandes sont exécutées "en arrière plan", sauf la dernière. diff --git a/missions/intermediate/05_control-C/i18n/en.po b/missions/intermediate/05_background/i18n/en.po similarity index 51% rename from missions/intermediate/05_control-C/i18n/en.po rename to missions/intermediate/05_background/i18n/en.po index f0ed9f4db..e9081ea2e 100644 --- a/missions/intermediate/05_control-C/i18n/en.po +++ b/missions/intermediate/05_background/i18n/en.po @@ -16,24 +16,19 @@ msgstr "$MISSION_DIR/skip/en.txt" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/en.txt" -msgid "Don't interrupt me when I'm in a trance!!!" -msgstr "Don't interrupt me when I'm in a trance!!!" +msgid "Great, that looked good!" +msgstr "Great, that looked good!" -#, sh-format -msgid "Found it! The special incantation is $n" -msgstr "Found it! The special incantation is $n" - -msgid "Merlin mumbles " -msgstr "Merlin mumbles " - -msgid "NOTE: you need to interrupt Merlin before he wakes up." -msgstr "NOTE: you need to interrupt Merlin before he wakes up." +msgid "Let's have a look:" +msgstr "Let's have a look:" -msgid "Sorry, I fell asleep... Let's try again." -msgstr "Sorry, I fell asleep... Let's try again." +#, sh-format +msgid "Mmm... I didn't see anything." +msgstr "Mmm... I didn't see anything." -msgid "What's the fireworks incantation?" -msgstr "What's the fireworks incantation?" +#, sh-format +msgid "Mmm... I only saw $NB fireworks. That's not enough." +msgstr "Mmm... I only saw $NB fireworks. That's not enough." msgid "charmiglio" msgstr "charmiglio" diff --git a/missions/intermediate/05_background/i18n/fr.po b/missions/intermediate/05_background/i18n/fr.po new file mode 100644 index 000000000..5347729e3 --- /dev/null +++ b/missions/intermediate/05_background/i18n/fr.po @@ -0,0 +1,33 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/fr.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/fr.txt" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/fr.txt" + +msgid "Great, that looked good!" +msgstr "Super, c'était très joli !" + +msgid "Let's have a look:" +msgstr "Regardons à quoi ça ressemble :" + +#, sh-format +msgid "Mmm... I didn't see anything." +msgstr "Mmm... Je n'ai rien vu." + +#, sh-format +msgid "Mmm... I only saw $NB fireworks. That's not enough." +msgstr "Mmm... Je n'ai vu que $NB feux d'artifices. Ce n'est pas assez." + +msgid "charmiglio" +msgstr "charmiglio" diff --git a/missions/intermediate/05_control-C/i18n/it.po b/missions/intermediate/05_background/i18n/it.po similarity index 50% rename from missions/intermediate/05_control-C/i18n/it.po rename to missions/intermediate/05_background/i18n/it.po index 3f142971a..cfe0e3511 100644 --- a/missions/intermediate/05_control-C/i18n/it.po +++ b/missions/intermediate/05_background/i18n/it.po @@ -1,3 +1,4 @@ +# AUTOMATICALLY GENERATED -- DO NOT EDIT msgid "" msgstr "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -5,7 +6,7 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n" # path for the text file containing the goal #, sh-format msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgstr "$MISSION_DIR/goal/en.txt" # path for the text file containing the skip message msgid "$MISSION_DIR/skip/en.txt" @@ -15,24 +16,19 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" -msgid "Don't interrupt me when I'm in a trance!!!" -msgstr "" - -#, sh-format -msgid "Found it! The special incantation is $n" -msgstr "" - -msgid "Merlin mumbles " -msgstr "" +msgid "Great, that looked good!" +msgstr "Great, that looked good!" -msgid "NOTE: you need to interrupt Merlin before he wakes up." -msgstr "" +msgid "Let's have a look:" +msgstr "Let's have a look:" -msgid "Sorry, I fell asleep... Let's try again." -msgstr "" +#, sh-format +msgid "Mmm... I didn't see anything." +msgstr "Mmm... I didn't see anything." -msgid "What's the fireworks incantation?" -msgstr "" +#, sh-format +msgid "Mmm... I only saw $NB fireworks. That's not enough." +msgstr "Mmm... I only saw $NB fireworks. That's not enough." msgid "charmiglio" -msgstr "" +msgstr "charmiglio" diff --git a/missions/intermediate/05_control-C/i18n/template.pot b/missions/intermediate/05_background/i18n/template.pot similarity index 62% rename from missions/intermediate/05_control-C/i18n/template.pot rename to missions/intermediate/05_background/i18n/template.pot index 9d60e3bdd..b96ab1952 100644 --- a/missions/intermediate/05_control-C/i18n/template.pot +++ b/missions/intermediate/05_background/i18n/template.pot @@ -15,23 +15,18 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" -msgid "Don't interrupt me when I'm in a trance!!!" +msgid "Great, that looked good!" msgstr "" -#, sh-format -msgid "Found it! The special incantation is $n" -msgstr "" - -msgid "Merlin mumbles " +msgid "Let's have a look:" msgstr "" -msgid "NOTE: you need to interrupt Merlin before he wakes up." -msgstr "" - -msgid "Sorry, I fell asleep... Let's try again." +#, sh-format +msgid "Mmm... I didn't see anything." msgstr "" -msgid "What's the fireworks incantation?" +#, sh-format +msgid "Mmm... I only saw $NB fireworks. That's not enough." msgstr "" msgid "charmiglio" diff --git a/missions/intermediate/05_control-C/init.sh b/missions/intermediate/05_background/init.sh similarity index 61% rename from missions/intermediate/05_control-C/init.sh rename to missions/intermediate/05_background/init.sh index ea16e3e90..4e0fba64f 100644 --- a/missions/intermediate/05_control-C/init.sh +++ b/missions/intermediate/05_background/init.sh @@ -1,9 +1,6 @@ #!/usr/bin/env sh _mission_init() { - # nb of tries to make - echo $((3 + $(RANDOM) % 3)) > "$GSH_TMP/control-C" - copy_bin "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" } _mission_init diff --git a/missions/intermediate/05_background/test.sh b/missions/intermediate/05_background/test.sh new file mode 100644 index 000000000..521355040 --- /dev/null +++ b/missions/intermediate/05_background/test.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env sh + +set -m + +gsh assert check false +charmiglio & gsh assert check false +charmiglio & charmiglio & gsh assert check false +charmiglio & charmiglio & charmiglio & gsh assert check true +charmiglio & charmiglio & charmiglio & charmiglio & gsh assert check true + +charmiglio & charmiglio & charmiglio +gsh assert check false + +charmiglio; charmiglio; charmiglio; +gsh assert check false + + diff --git a/missions/intermediate/05_control-C/auto.sh b/missions/intermediate/05_control-C/auto.sh deleted file mode 100644 index 4dc721f7e..000000000 --- a/missions/intermediate/05_control-C/auto.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/usr/bin/env sh - -set -m - -for _ in $(seq 6) -do - eval "$(gettext charmiglio)" 2>/dev/null & - PID=$! - sleep 3 - kill -s INT "-$PID" 2> /dev/null - - case "$(cat "$GSH_TMP/control-C")" in - *[!0-9]*) - break - ;; - *) - : - ;; - esac -done - -gsh check < "$GSH_TMP/control-C" - - diff --git a/missions/intermediate/05_control-C/charmiglio.sh b/missions/intermediate/05_control-C/charmiglio.sh deleted file mode 100755 index c1583a163..000000000 --- a/missions/intermediate/05_control-C/charmiglio.sh +++ /dev/null @@ -1,96 +0,0 @@ -#!/bin/sh - -. gsh_gettext.sh - -control_c_start() { - [ -f "$GSH_TMP/control-C" ] || exit 255 - n=$(cat "$GSH_TMP/control-C") - case "$n" in - "" | *[!0-9]* ) - echo - echo - echo "$(eval_gettext 'Found it! The special incantation is $n')" - ;; - *) - echo - echo - echo "$(gettext "Don't interrupt me when I'm in a trance!!!")" - ;; - esac - exit 1 -} - -control_c_end() { - [ -f "$GSH_TMP/control-C" ] || exit 255 - n=$(cat "$GSH_TMP/control-C") - case "$n" in - "" | *[!0-9]* ) - echo - echo - echo "$(eval_gettext 'Found it! The special incantation is $n')" - ;; - *) - echo "$((n-1))" > "$GSH_TMP/control-C" - echo - echo - echo "$(gettext "Sorry, I fell asleep... Let's try again.")" - ;; - esac - exit 1 -} - -mumble() { - seconds=$1 # how long to mumble randomly (real time will be between $seconds and $seconds+1 - sleep=$2 # should '.' characters appears as times passes - - now=$(date +%s) - d=0 - while [ "$d" -le "$seconds" ] - do - d=$(($(date +%s) - now + 1)) - printf "$(gettext "Merlin mumbles ")" >&2 - if [ "$sleep" ] - then - # generate a string of length 26 containing more and more '.' characters - i=$((d*2)) - alpha=$(echo "xnyjqmiwkgbplvadrhfuotcsez.........................." | awk "{print substr(\$0, $i<27?$i:27, 26)}" ) - else - alpha="a-z" - fi - random_string "$((8 + $(RANDOM)%42))" | tr "a-zA-Z" "$alpha " >&2 - sleep 0.1 - done -} - -check() { - [ -f "$GSH_TMP/control-C" ] || exit 255 - n=$(cat "$GSH_TMP/control-C") - case "$n" in - "" | *[!0-9]* ) - # we already know the solution - echo - echo "$(eval_gettext 'Found it! The special incantation is $n')" - exit 0 - ;; - *) - if [ "$n" -le 0 ] - then - # if we've finished, print the solution and save it - n=$(random_string 5) - echo "$n" > "$GSH_TMP/control-C" - echo - echo "$(eval_gettext 'Found it! The special incantation is $n')" - exit 0 - fi - esac -} - -trap 'control_c_start' INT -mumble 2 # mumble for 2 second -check -trap 'control_c_end' INT -mumble 120 sleep # mumble for 2 minutes, falling to sleep -echo -echo "$(gettext "Sorry, I fell asleep... Let's try again.")" - -echo "$(gettext "NOTE: you need to interrupt Merlin before he wakes up.")" diff --git a/missions/intermediate/05_control-C/clean.sh b/missions/intermediate/05_control-C/clean.sh deleted file mode 100644 index f230756ac..000000000 --- a/missions/intermediate/05_control-C/clean.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env sh - -rm -f "$GSH_TMP/control-C" diff --git a/missions/intermediate/05_control-C/goal/en.txt b/missions/intermediate/05_control-C/goal/en.txt deleted file mode 100644 index 506b30730..000000000 --- a/missions/intermediate/05_control-C/goal/en.txt +++ /dev/null @@ -1,28 +0,0 @@ -Mission goal -============ - -The wizard Merlin appears next to you and asks for your help. -You need to whisper the magic word - $ $command -to put him into a trance so that he can remember a special -incantation for creating fireworks. - -The only problem is that after a couple of seconds in a trance, -Merlin falls asleep! You thus need to interrupt him whenever -that's the case, so that he can try again. - - -NOTE: it will probably take several tries before Merlin -actually remembers the incantation - - -Useful commands -=============== - -$command - this (non standard) command puts Merlin into a trance - -Control-c (also written ^c) - pressing Control and c at the same times interrupts the current command - by sending the INT ("INTerrupt") signal to the process - diff --git a/missions/intermediate/05_control-C/goal/fr.txt b/missions/intermediate/05_control-C/goal/fr.txt deleted file mode 100644 index 18b6e95ac..000000000 --- a/missions/intermediate/05_control-C/goal/fr.txt +++ /dev/null @@ -1,29 +0,0 @@ -Objectif -========= - -Le sorcier Merlin apparait à vos cotés et vous demande de -l'aide. Vous devez murmurer le mot magique - $ $command -pour le mettre dans une transe qui devrait lui permettre de -se souvenir d'une incantation spéciale pour créer des feux -d'artifice. - -Le seul problème est qu'après quelques secondes en transe, -Merlin s'endort ! Vous devez donc l'interrompre dans ce cas -pour qu'il puisse ré-essayer. - - -NOTE: il faudra probablement plusieurs essais pour que -Merlin retrouve son incantation. - - -Commandes utiles -================ - -$command - cette commande (non standard) met Merlin dans une transe - -Contrôle-c (aussi noté ^c) - appuyer sur les touches Contrôle et c en même temps interrompt - la commande en cours en envoyant le signal INT ("INTerrupt") au - processus diff --git a/missions/intermediate/05_control-C/i18n/fr.po b/missions/intermediate/05_control-C/i18n/fr.po deleted file mode 100644 index 1101d7049..000000000 --- a/missions/intermediate/05_control-C/i18n/fr.po +++ /dev/null @@ -1,42 +0,0 @@ -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" - -# path for the text file containing the goal -#, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/fr.txt" - -# path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "" - -# path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "" - -msgid "Don't interrupt me when I'm in a trance!!!" -msgstr "Ne m'interromps pas pendant ma transe !!!" - -#, sh-format -msgid "Found it! The special incantation is $n" -msgstr "Trouvé ! L'incantation spéciale est $n" - -msgid "Merlin mumbles " -msgstr "Merlin marmonne " - -msgid "NOTE: you need to interrupt Merlin before he wakes up." -msgstr "NOTE : vous devez interrompre Merlin avant son réveil." - -msgid "Sorry, I fell asleep... Let's try again." -msgstr "Désolé, je m'étais endormi... Essayons encore." - -msgid "What's the fireworks incantation?" -msgstr "Quelle est l'incantation pour les feux d'artifice ?" - -msgid "charmiglio" -msgstr "charmiglio" - -#, fuzzy, sh-format -#~ msgid "Found it! The special incantion is $n" -#~ msgstr "Trouvé ! L'incantation spéciale est $n" diff --git a/missions/intermediate/06_control-C/Charmiglio.sh b/missions/intermediate/06_control-C/Charmiglio.sh new file mode 100755 index 000000000..31edfa945 --- /dev/null +++ b/missions/intermediate/06_control-C/Charmiglio.sh @@ -0,0 +1,125 @@ +#!/bin/sh + +. gsh_gettext.sh + +CODE=$1 +STATE=init + +trap 'control_c' INT +control_c() { + if [ "$STATE" = "init" ] + then + echo + echo "$(eval_gettext 'Too soon! You must leave enough time for the magical reaction to start!')" + exit 1 + else + echo + cat "$MISSION_DIR/ascii-art/explosion.txt" + echo "$(gettext "That's not working, try a different combination...")" + fi + exit 1 +} + + +indent=8 +width=16 +magical_reaction() { + seconds=$1 # how long to magical_reaction randomly (real time will be between $seconds and $seconds+1 + dud=$2 # should more '.' characters appears as times passes + + now=$(date +%s) + delay=0 + while [ "$delay" -le "$seconds" ] + do + delay=$(($(date +%s) - now)) + # NOTE: if I put $(RANDOM) inside the $((...)), interrupting the process during + # the RANDOM execution returns an empty string, and the shell complains about + # invalid arithmetic expression + r=$(RANDOM) + indent=$((indent - 2 + r%5)) + [ "$indent" -lt 0 ] && indent=0 + r=$(RANDOM) + width=$((width - 2 + r%5)) + [ "$width" -lt 1 ] && width=1 + if [ "$dud" ] + then + i=$((delay/2 + 2)) + else + i=1 + fi + alpha=$(echo "#%*():_-............." | awk "{print substr(\$0, $i<10?$i:10, 10)}" ) + printf "%*s%s\n" "$indent" '' "$(random_string "$width" "$alpha")" >&2 + sleep 0.1 + done +} + +check() { + [ -f "$GSH_TMP/control-C" ] || exit 255 + n=$(cat "$GSH_TMP/control-C") + case "$n" in + "" | *[!0-9]* ) + if [ "$n" = "$CODE" ] + then + echo + echo "$(eval_gettext 'It works! The special incantation is $CODE')" + cat "$MISSION_DIR/ascii-art/fireworks.txt" + exit 0 + else + echo "$CODE" >> "$GSH_TMP/control-C.codes" + fi + ;; + *) + if [ "$n" -le 0 ] + then + # if we've finished, print the solution and save it + echo "$CODE" > "$GSH_TMP/control-C" + echo + echo "$(eval_gettext 'It works! The special incantation is $CODE')" + cat "$MISSION_DIR/ascii-art/fireworks.txt" + exit 0 + else + echo "$CODE" >> "$GSH_TMP/control-C.codes" + echo "$((n-1))" > "$GSH_TMP/control-C" + fi + esac + STATE="final" +} + +init() { + case "$CODE" in + "") + command=$(gettext "Charmiglio") + echo "$(eval_gettext 'usage: $command CCCC + where CCCC is a sequence of 4 ASCII letters (a-zA-Z)')" + exit 1 + ;; + + *[!a-zA-Z]*) + echo "$(gettext "The incantation can only use ASCII letters.")" + exit 1 + ;; + ????) + : # 4 letters, OK + ;; + *) + echo "$(gettext "The incantation requires exactly 4 letters.")" + exit 1 + ;; + esac + + if grep -qsx "$CODE" "$GSH_TMP/control-C.codes" + then + echo "already tried!" + exit 1 + fi +} + + +init +magical_reaction 2 # magical reaction for 2 second +check +magical_reaction 600 dud # dud for 10 minutes + +echo +echo "$(gettext "That's not working, try a different combination...")" +echo "$(gettext "NOTE: you should interrupt the magical reaction after a few seconds!")" diff --git a/missions/intermediate/06_control-C/Makefile b/missions/intermediate/06_control-C/Makefile new file mode 100644 index 000000000..bd85007b1 --- /dev/null +++ b/missions/intermediate/06_control-C/Makefile @@ -0,0 +1,41 @@ +SH_FILES=$(wildcard *.sh) +EXCEPTIONS= +OTHER_FILES= + +LANGUAGES=$(wildcard i18n/*.po) +LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) +SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) +SORT=--sort-output +OPTIONS=--indent --no-wrap --no-location + +all: i18n/en.po $(LANGUAGES) + +add-locations: SORT=--add-location --sort-by-file +add-locations: all + +i18n/en.po: i18n/template.pot FORCE + @echo "msgen $@" + @msgen $(OPTIONS) $(SORT) i18n/template.pot --output=$@ + @echo "# AUTOMATICALLY GENERATED -- DO NOT EDIT" | cat - $@ > $@~ + @mv $@~ $@ + +$(LANGUAGES):%.po: i18n/template.pot FORCE + @echo "msgmerge $@" + @msgmerge --update $(OPTIONS) $(SORT) $@ i18n/template.pot + +i18n/template.pot: $(SH_FILES) $(OTHER_FILES) FORCE + @mkdir -p i18n/ + @echo "generating i18n/template.pot" + @xgettext --from-code=UTF-8 --omit-header $(OPTIONS) $(SORT) --join-existing --output i18n/template.pot $(SH_FILES) $(OTHER_FILES) + @echo "done" + +new: i18n/template.pot + @read -p "language code: " lang; \ + [ -e "./i18n/$$lang.po" ] && echo "file i18n/$$lang.po already exists" && exit; \ + echo "file i18n/$$lang.po created"; \ + msgcat $(OPTIONS) --output i18n/$$lang.po i18n/template.pot + +clean: + rm -f i18n/*~ + +.PHONY: all clean new FORCE diff --git a/missions/intermediate/05_control-C/ascii-art/explosion.txt b/missions/intermediate/06_control-C/ascii-art/explosion.txt similarity index 100% rename from missions/intermediate/05_control-C/ascii-art/explosion.txt rename to missions/intermediate/06_control-C/ascii-art/explosion.txt diff --git a/missions/intermediate/05_control-C/ascii-art/fireworks.txt b/missions/intermediate/06_control-C/ascii-art/fireworks.txt similarity index 100% rename from missions/intermediate/05_control-C/ascii-art/fireworks.txt rename to missions/intermediate/06_control-C/ascii-art/fireworks.txt diff --git a/missions/intermediate/06_control-C/auto.sh b/missions/intermediate/06_control-C/auto.sh new file mode 100644 index 000000000..63e4eb2c7 --- /dev/null +++ b/missions/intermediate/06_control-C/auto.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +set -m + + for c in a b c d e f + do + eval "$(gettext Charmiglio)" "$c$c$c$c" 2>/dev/null & + PID=$! + sleep 4 + kill -s INT "-$PID" 2> /dev/null + + case "$(cat "$GSH_TMP/control-C")" in + *[!0-9]*) + break + ;; + *) + : + ;; + esac + done + +gsh check < "$GSH_TMP/control-C" + + diff --git a/missions/intermediate/05_control-C/check.sh b/missions/intermediate/06_control-C/check.sh similarity index 50% rename from missions/intermediate/05_control-C/check.sh rename to missions/intermediate/06_control-C/check.sh index f70584c0f..4497b37fd 100644 --- a/missions/intermediate/05_control-C/check.sh +++ b/missions/intermediate/06_control-C/check.sh @@ -2,22 +2,22 @@ _mission_check() { r=$(cat "$GSH_TMP/control-C") - printf "%s " "$(gettext "What's the fireworks incantation?")" + printf "%s " "$(gettext "What's a valid 4 letters sequence?")" read -r n case "$r" in - "" | *[!0-9]*) + *[!a-zA-Z]*) + return 1 + ;; + ????) if [ "$n" = "$r" ] then - cat "$MISSION_DIR/ascii-art/fireworks.txt" return 0 else - cat "$MISSION_DIR/ascii-art/explosion.txt" return 1 fi ;; *) - cat "$MISSION_DIR/ascii-art/explosion.txt" return 1 esac } diff --git a/missions/intermediate/06_control-C/clean.sh b/missions/intermediate/06_control-C/clean.sh new file mode 100644 index 000000000..01fe2e36a --- /dev/null +++ b/missions/intermediate/06_control-C/clean.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +rm -f "$GSH_TMP/control-C*" diff --git a/missions/intermediate/06_control-C/goal.sh b/missions/intermediate/06_control-C/goal.sh new file mode 100644 index 000000000..2edb9b32c --- /dev/null +++ b/missions/intermediate/06_control-C/goal.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env sh + +command="$(gettext 'Charmiglio')" +sed "s/\\\$command/$command/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" +unset command diff --git a/missions/intermediate/06_control-C/goal/en.txt b/missions/intermediate/06_control-C/goal/en.txt new file mode 100644 index 000000000..0557f4385 --- /dev/null +++ b/missions/intermediate/06_control-C/goal/en.txt @@ -0,0 +1,36 @@ +Mission goal +============ + +The king's pyrotechnician is trying to remember the magical incantation +for creating the grand finale for his fireworks. This incantation starts +with the work $command and must be followed by four random letters, as +in + + $ $command abcd +or + $ $command oops + +Help the pyrotechnician by finding 4 letters producing appropriate +fireworks. + + +NOTE: when the four letters are incorrect, the magical reaction +can take a very long time. You need to interrupt it! + +It will probably take several tries before finding a combination +of letters that works. + + +Useful commands +=============== + +$command CCCC + this (non standard) command creates some fireworks + - if the four letters are valid, the fireworks will start after a few + seconds + - if the four letters are not valid, the whole magical reaction will go + on for a long time + +Control-c (also written ^c) + pressing Control and c at the same times interrupts the current command + by sending the INT ("INTerrupt") signal to the process diff --git a/missions/intermediate/06_control-C/goal/fr.txt b/missions/intermediate/06_control-C/goal/fr.txt new file mode 100644 index 000000000..b9de6d5b8 --- /dev/null +++ b/missions/intermediate/06_control-C/goal/fr.txt @@ -0,0 +1,36 @@ +Objectif +========= + +L'artificier royal essaie de se souvenir de l'incantation magique qui génère +le bouquet final de son grand feu d'artifices. Cette incantation commence par +le mot $command et doit être suivie de quatre lettres aléatoires comme dans + + $ $command abcd +ou + $ $command oups + +Aidez l'artificier en trouvant quatres lettres qui produisent un feu +d'artifices approprié. + + +NOTE: lorsque les quatres lettres sont incorrectes, la réaction +magique peut prendre beaucoup de temps. Il faudra l'interrompre ! + +Il est probable que vous deviez faire plusieurs essais pour +trouver une suite de quatre lettres qui fonctionne. + + +Commandes utiles +================ + +$command CCCC + cette commande (non standard) génère un feu d'artifice + - si les quatre lettres sont valides, le feu d'artifice partira + au bout de quelques secondes + - si les quatres lettres ne sont pas valides, la réaction magique + continuera pendant longtemps + +Contrôle-c (aussi noté ^c) + appuyer sur les touches Contrôle et c en même temps interrompt + la commande en cours en envoyant le signal INT ("INTerrupt") au + processus diff --git a/missions/intermediate/06_control-C/i18n/en.po b/missions/intermediate/06_control-C/i18n/en.po new file mode 100644 index 000000000..a9a48bdc4 --- /dev/null +++ b/missions/intermediate/06_control-C/i18n/en.po @@ -0,0 +1,49 @@ +# AUTOMATICALLY GENERATED -- DO NOT EDIT +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/en.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/en.txt" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/en.txt" + +msgid "Charmiglio" +msgstr "Charmiglio" + +#, sh-format +msgid "It works! The special incantation is $CODE" +msgstr "It works! The special incantation is $CODE" + +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "NOTE: you should interrupt the magical reaction after a few seconds!" + +msgid "That's not working, try a different combination..." +msgstr "That's not working, try a different combination..." + +msgid "The incantation can only use ASCII letters." +msgstr "The incantation can only use ASCII letters." + +msgid "The incantation requires exactly 4 letters." +msgstr "The incantation requires exactly 4 letters." + +#, sh-format +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "Too soon! You must leave enough time for the magical reaction to start!" + +msgid "What's a valid 4 letters sequence?" +msgstr "What's a valid 4 letters sequence?" + +#, sh-format +msgid "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/fr.po b/missions/intermediate/06_control-C/i18n/fr.po new file mode 100644 index 000000000..48a249ed7 --- /dev/null +++ b/missions/intermediate/06_control-C/i18n/fr.po @@ -0,0 +1,48 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/fr.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +msgid "Charmiglio" +msgstr "Charmiglio" + +#, sh-format +msgid "It works! The special incantation is $CODE" +msgstr "Ça marche ! L'incantation spéciale est $CODE" + +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "NOTE : vous devriez interrompre la réaction magique après quelques secondes !" + +msgid "That's not working, try a different combination..." +msgstr "Ça ne marche pas, essayez une autre combinaison..." + +msgid "The incantation can only use ASCII letters." +msgstr "L'incantation ne peut utiliser que des lettres ASCII." + +msgid "The incantation requires exactly 4 letters." +msgstr "L'incantation nécessite exactement 4 lettres." + +#, sh-format +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "Trop tôt ! Vous devez laisser assez de temps pour que la réaction magique commence !" + +msgid "What's a valid 4 letters sequence?" +msgstr "Qu'est-ce qu'une combinaison valide ?" + +#, sh-format +msgid "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "utilisation : $command CCCC\n" + " où CCCC est une suite de 4 lettres ASCII (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/it.po b/missions/intermediate/06_control-C/i18n/it.po new file mode 100644 index 000000000..693fda767 --- /dev/null +++ b/missions/intermediate/06_control-C/i18n/it.po @@ -0,0 +1,49 @@ +# AUTOMATICALLY GENERATED -- DO NOT EDIT +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/en.txt" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +msgid "Charmiglio" +msgstr "Charmiglio" + +#, sh-format +msgid "It works! The special incantation is $CODE" +msgstr "It works! The special incantation is $CODE" + +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "NOTE: you should interrupt the magical reaction after a few seconds!" + +msgid "That's not working, try a different combination..." +msgstr "That's not working, try a different combination..." + +msgid "The incantation can only use ASCII letters." +msgstr "The incantation can only use ASCII letters." + +msgid "The incantation requires exactly 4 letters." +msgstr "The incantation requires exactly 4 letters." + +#, sh-format +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "Too soon! You must leave enough time for the magical reaction to start!" + +msgid "What's a valid 4 letters sequence?" +msgstr "What's a valid 4 letters sequence?" + +#, sh-format +msgid "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/template.pot b/missions/intermediate/06_control-C/i18n/template.pot new file mode 100644 index 000000000..416128eea --- /dev/null +++ b/missions/intermediate/06_control-C/i18n/template.pot @@ -0,0 +1,47 @@ +msgid "" +msgstr "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + +# path for the text file containing the goal +#, sh-format +msgid "$MISSION_DIR/goal/en.txt" +msgstr "" + +# path for the text file containing the skip message +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" + +# path for the text file containing the treasure message +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" + +msgid "Charmiglio" +msgstr "" + +#, sh-format +msgid "It works! The special incantation is $CODE" +msgstr "" + +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "" + +msgid "That's not working, try a different combination..." +msgstr "" + +msgid "The incantation can only use ASCII letters." +msgstr "" + +msgid "The incantation requires exactly 4 letters." +msgstr "" + +#, sh-format +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "" + +msgid "What's a valid 4 letters sequence?" +msgstr "" + +#, sh-format +msgid "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "" diff --git a/missions/intermediate/06_control-C/init.sh b/missions/intermediate/06_control-C/init.sh new file mode 100644 index 000000000..d081f8ddb --- /dev/null +++ b/missions/intermediate/06_control-C/init.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env sh + +_mission_init() { + # nb of tries to make + echo $((2 + $(RANDOM) % 3)) > "$GSH_TMP/control-C" + rm -f "$GSH_TMP/control-C.codes" + + copy_bin "$MISSION_DIR/Charmiglio.sh" "$GSH_BIN/$(gettext Charmiglio)" +} +_mission_init diff --git a/missions/intermediate/05_control-C/test.sh b/missions/intermediate/06_control-C/test.sh similarity index 74% rename from missions/intermediate/05_control-C/test.sh rename to missions/intermediate/06_control-C/test.sh index f47c342e8..7f6d11c1c 100644 --- a/missions/intermediate/05_control-C/test.sh +++ b/missions/intermediate/06_control-C/test.sh @@ -6,9 +6,9 @@ do_test() { nb=$1 delay=$2 - for _ in $(seq "$nb") + for c in $(echo "a b c d e f g h i j" | cut -d' ' -f1-$nb) do - eval "$(gettext charmiglio)" 2>/dev/null & + eval "$(gettext Charmiglio)" "$c$c$c$c" 2>/dev/null & PID=$! sleep "$delay" kill -s INT "-$PID" 2> /dev/null @@ -27,8 +27,8 @@ do_test() { do_test 10 0.3 gsh assert check false < "$GSH_TMP/control-C" -do_test 3 3 +do_test 2 4 gsh assert check false < "$GSH_TMP/control-C" -do_test 6 3 +do_test 6 4 gsh assert check true < "$GSH_TMP/control-C" diff --git a/missions/intermediate/index.txt b/missions/intermediate/index.txt index 9bca21db2..4a518eb45 100644 --- a/missions/intermediate/index.txt +++ b/missions/intermediate/index.txt @@ -2,4 +2,5 @@ 02_alias_journal 03_tab_spider_lair 04_bg_xeyes -05_control-C +05_background +06_control-C From b4ab210c1530c861b501922557cd7136b599c9d4 Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 29 Aug 2024 14:05:48 +0200 Subject: [PATCH 043/103] feat(l1on): italian for 2 new missions --- .../intermediate/05_background/goal/it.txt | 28 ++++++++ .../intermediate/05_background/i18n/it.po | 48 ++++++++----- .../intermediate/06_control-C/goal/it.txt | 33 +++++++++ missions/intermediate/06_control-C/i18n/it.po | 71 +++++++++++-------- 4 files changed, 132 insertions(+), 48 deletions(-) create mode 100644 missions/intermediate/05_background/goal/it.txt create mode 100644 missions/intermediate/06_control-C/goal/it.txt diff --git a/missions/intermediate/05_background/goal/it.txt b/missions/intermediate/05_background/goal/it.txt new file mode 100644 index 000000000..876652f2e --- /dev/null +++ b/missions/intermediate/05_background/goal/it.txt @@ -0,0 +1,28 @@ +Obiettivi missione +============ + +IL pirotecnico del re appare vicino a te. Ti chiede se ne puoi accendere **almeno +3** così che possa vederli da lontano. + +Un singolo fuoco d'artificio può essere acceso con: + + $command + + +Comandi utili +=============== + +$command + questo commando (non standard) crea un piccolo fuoco d'artificio + +COMMAND & + esegue il comando, ma non aspetta finchè il comando ha finito per tornare al terminale + Il commando verrà eseguito in "background". + +COMMAND1 ; COMMAND2 ; ... ; COMMANDn + esegue i comandi uno dopo l'altro + Ogni comando è eseguito quando il precedente ha finito + +COMMAND1 & COMMAND2 & ... & COMMANDn + esegue i comandi "in parallelo" + Tutti i comandi sono eseguito in "background", eccetto l'ultimo. diff --git a/missions/intermediate/05_background/i18n/it.po b/missions/intermediate/05_background/i18n/it.po index cfe0e3511..ecc03ae96 100644 --- a/missions/intermediate/05_background/i18n/it.po +++ b/missions/intermediate/05_background/i18n/it.po @@ -1,34 +1,44 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" +# mte90 , 2024. +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Last-Translator: mte90 \n" +"PO-Revision-Date: 2024-08-29 13:53+0200\n" +"Project-Id-Version: \n" +"Language-Team: Italian \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 22.12.3\n" # path for the text file containing the goal #, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/en.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" -msgid "Great, that looked good!" -msgstr "Great, that looked good!" +msgid "Great, that looked good!" +msgstr "Ottimo, sembra tutto a posto!" -msgid "Let's have a look:" -msgstr "Let's have a look:" +msgid "Let's have a look:" +msgstr "Vediamo insieme:" #, sh-format -msgid "Mmm... I didn't see anything." -msgstr "Mmm... I didn't see anything." +msgid "Mmm... I didn't see anything." +msgstr "Mmm... non vedo niente." #, sh-format -msgid "Mmm... I only saw $NB fireworks. That's not enough." -msgstr "Mmm... I only saw $NB fireworks. That's not enough." +msgid "Mmm... I only saw $NB fireworks. That's not enough." +msgstr "Mmm... io vedo solo $NB fuochi d'artificio. Non sono sufficenti." -msgid "charmiglio" -msgstr "charmiglio" +msgid "charmiglio" +msgstr "charmiglio" diff --git a/missions/intermediate/06_control-C/goal/it.txt b/missions/intermediate/06_control-C/goal/it.txt new file mode 100644 index 000000000..05c45c187 --- /dev/null +++ b/missions/intermediate/06_control-C/goal/it.txt @@ -0,0 +1,33 @@ +Obiettivi missione +============ + +Il pirotecnico del re sta cercando di rcordarsi gli incantesimi magici +per creare il gran finale per il suo spettacolo. Questo incantesimo comincia +il lavoro $command e deve essere seguito da 4 lettere casuali come + + $ $command abcd +o + $ $command oops + +Aiuta il pirotecnico trovando 4 lettere per lanciare i fuochi giusti. + + +NOTA: quando le quattro lettere sono sbagliate, la reazione magica +può richiedere molto tempo. Devi interromperla! + +Sarà necessario provare diverse volte per trovare la combinazione giusta di +lettere che funziona. + + +Comandi utili +=============== + +$command CCCC + questo comando (non standard) create alcuni fuochi d'artificio + - se le quattro lettere sono valide, i fuochi cominceranno dopo pochi secondi + - se le quattro lettere non sono valide, la reazione magica richiederà molto + tempo per fallire + +Control-c (scritto anche come ^c) + premendo Control e c allo stesso tempo interrompe il comando attuale + inviando il segnale di INTerruzione al processo diff --git a/missions/intermediate/06_control-C/i18n/it.po b/missions/intermediate/06_control-C/i18n/it.po index 693fda767..897dd2291 100644 --- a/missions/intermediate/06_control-C/i18n/it.po +++ b/missions/intermediate/06_control-C/i18n/it.po @@ -1,49 +1,62 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT -msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" - "Content-Transfer-Encoding: 8bit\n" +# mte90 , 2024. +msgid "" +msgstr "" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Last-Translator: mte90 \n" +"PO-Revision-Date: 2024-08-29 14:05+0200\n" +"Project-Id-Version: \n" +"Language-Team: Italian \n" +"Language: it_IT\n" +"MIME-Version: 1.0\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Lokalize 22.12.3\n" # path for the text file containing the goal #, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/en.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" -msgid "Charmiglio" -msgstr "Charmiglio" +msgid "Charmiglio" +msgstr "Charmiglio" #, sh-format -msgid "It works! The special incantation is $CODE" -msgstr "It works! The special incantation is $CODE" +msgid "It works! The special incantation is $CODE" +msgstr "Funziona! L'incantesimo speciale è $CODE" -msgid "NOTE: you should interrupt the magical reaction after a few seconds!" -msgstr "NOTE: you should interrupt the magical reaction after a few seconds!" +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "NOTA: puoi interrompere la reazione magica dopo pochi secondi!" -msgid "That's not working, try a different combination..." -msgstr "That's not working, try a different combination..." +msgid "That's not working, try a different combination..." +msgstr "Non ha funzionato, prova una combinazione differente..." -msgid "The incantation can only use ASCII letters." -msgstr "The incantation can only use ASCII letters." +msgid "The incantation can only use ASCII letters." +msgstr "L'incantesimo può utilizzare solo caratteri ASCII." -msgid "The incantation requires exactly 4 letters." -msgstr "The incantation requires exactly 4 letters." +msgid "The incantation requires exactly 4 letters." +msgstr "L'incantesimo richiede esattamente 4 lettere." #, sh-format -msgid "Too soon! You must leave enough time for the magical reaction to start!" -msgstr "Too soon! You must leave enough time for the magical reaction to start!" +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "" +"Troppo presto! Devi dare abbastanza tempo per l'avvio della reazione magica!" -msgid "What's a valid 4 letters sequence?" -msgstr "What's a valid 4 letters sequence?" +msgid "What's a valid 4 letters sequence?" +msgstr "Cosa è una sequenza valida di 4 lettere?" #, sh-format -msgid "usage: $command CCCC\n" - " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" -msgstr "usage: $command CCCC\n" - " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgid "" +"usage: $command CCCC\n" +" where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "" +"uso: $command CCCC\n" +" dove CCCC è una sequenza di 4 caratteri ASCII (a-zA-Z)" From ce693a8bcdbfe32d6c463fd79e8941fe6aefc03d Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 29 Aug 2024 14:06:55 +0200 Subject: [PATCH 044/103] feat(l1on): italian for 2 new missions --- missions/intermediate/05_background/goal/it.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/missions/intermediate/05_background/goal/it.txt b/missions/intermediate/05_background/goal/it.txt index 876652f2e..9fc94fa40 100644 --- a/missions/intermediate/05_background/goal/it.txt +++ b/missions/intermediate/05_background/goal/it.txt @@ -17,7 +17,7 @@ $command COMMAND & esegue il comando, ma non aspetta finchè il comando ha finito per tornare al terminale - Il commando verrà eseguito in "background". + Il comando verrà eseguito in "background". COMMAND1 ; COMMAND2 ; ... ; COMMANDn esegue i comandi uno dopo l'altro @@ -25,4 +25,4 @@ COMMAND1 ; COMMAND2 ; ... ; COMMANDn COMMAND1 & COMMAND2 & ... & COMMANDn esegue i comandi "in parallelo" - Tutti i comandi sono eseguito in "background", eccetto l'ultimo. + Tutti i comandi sono eseguiti in "background", eccetto l'ultimo. From 9ab206dd32cc43506efccde201b2d014a5f197bf Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 29 Aug 2024 14:18:02 +0200 Subject: [PATCH 045/103] minor changes in a couple of goal files --- missions/intermediate/04_bg_xeyes/goal/en.txt | 6 +++--- missions/intermediate/04_bg_xeyes/goal/fr.txt | 7 ++++--- missions/intermediate/05_background/goal/en.txt | 8 ++++---- missions/intermediate/05_background/goal/fr.txt | 10 +++++----- missions/intermediate/06_control-C/goal/en.txt | 10 +++++----- missions/intermediate/06_control-C/goal/fr.txt | 10 +++++----- 6 files changed, 26 insertions(+), 25 deletions(-) diff --git a/missions/intermediate/04_bg_xeyes/goal/en.txt b/missions/intermediate/04_bg_xeyes/goal/en.txt index 9705bfe55..be10335ac 100644 --- a/missions/intermediate/04_bg_xeyes/goal/en.txt +++ b/missions/intermediate/04_bg_xeyes/goal/en.txt @@ -18,6 +18,6 @@ xeyes COMMAND & Run the command in the background. -Control-c - This key binding usually interrupts the current command by sending - it the "INT" signal. +Control-c (also written ^c) + Pressing Control and c at the same times interrupts the current command + by sending the INT ("INTerrupt") signal to the process. diff --git a/missions/intermediate/04_bg_xeyes/goal/fr.txt b/missions/intermediate/04_bg_xeyes/goal/fr.txt index cc79deef2..0e8540bc2 100644 --- a/missions/intermediate/04_bg_xeyes/goal/fr.txt +++ b/missions/intermediate/04_bg_xeyes/goal/fr.txt @@ -19,6 +19,7 @@ xeyes COMMANDE & Lance la commande en tâche de fond. -Control-c - Cette combinaison de touche permet (en général) d'interrompre la - commande en cours d'exécution en lui envoyant le signal "INT". +Contrôle-c (aussi noté ^c) + Appuyer sur les touches Contrôle et c en même temps interrompt + la commande en cours en envoyant le signal INT ("INTerrupt") au + processus. diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt index fc02db191..f6b7e9595 100644 --- a/missions/intermediate/05_background/goal/en.txt +++ b/missions/intermediate/05_background/goal/en.txt @@ -13,16 +13,16 @@ Useful commands =============== $command - this (non standard) command creates a single small firework + This (non standard) command creates a single small firework. COMMAND & - run the given command, but don't wait until it is finished to return + Run the given command, but don't wait until it is finished to return. The command will run in the "background". COMMAND1 ; COMMAND2 ; ... ; COMMANDn - run the given commands one after the other + Run the given commands one after the other. Each command is run when the previous one is finished. COMMAND1 & COMMAND2 & ... & COMMANDn - run the given commands "in parallel" + Run the given commands "in parallel". All the commands are run in the "background", except the last one. diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt index 7244ff094..96ef02cd7 100644 --- a/missions/intermediate/05_background/goal/fr.txt +++ b/missions/intermediate/05_background/goal/fr.txt @@ -13,17 +13,17 @@ Commandes utiles ================ $command - cette commande (non standard) lance un feu d'artifice simple + Cette commande (non standard) lance un feu d'artifice simple. COMMANDE & - exécute la commande mais n'attend pas qu'elle soit terminée pour reprendre - l'exécution du shell + Exécute la commande mais n'attend pas qu'elle soit terminée pour reprendre + l'exécution du shell. La commande s'exécute "en arrière plan". COMMAND1 ; COMMAND2 ; ... ; COMMANDn - exécute les commandes données, l'une après l'autre + Exécute les commandes données, l'une après l'autre. Chaque commande est exécutée lorsque la précédente est terminée. COMMAND1 & COMMAND2 & ... & COMMANDn - exécute les commandes données, "en parallèle" + Exécute les commandes données, "en parallèle". Toutes les commandes sont exécutées "en arrière plan", sauf la dernière. diff --git a/missions/intermediate/06_control-C/goal/en.txt b/missions/intermediate/06_control-C/goal/en.txt index 0557f4385..3b6edee23 100644 --- a/missions/intermediate/06_control-C/goal/en.txt +++ b/missions/intermediate/06_control-C/goal/en.txt @@ -25,12 +25,12 @@ Useful commands =============== $command CCCC - this (non standard) command creates some fireworks + This (non standard) command creates some fireworks: - if the four letters are valid, the fireworks will start after a few - seconds + seconds, - if the four letters are not valid, the whole magical reaction will go - on for a long time + on for a long time. Control-c (also written ^c) - pressing Control and c at the same times interrupts the current command - by sending the INT ("INTerrupt") signal to the process + Pressing Control and c at the same times interrupts the current command + by sending the INT ("INTerrupt") signal to the process. diff --git a/missions/intermediate/06_control-C/goal/fr.txt b/missions/intermediate/06_control-C/goal/fr.txt index b9de6d5b8..0bc6e58fe 100644 --- a/missions/intermediate/06_control-C/goal/fr.txt +++ b/missions/intermediate/06_control-C/goal/fr.txt @@ -24,13 +24,13 @@ Commandes utiles ================ $command CCCC - cette commande (non standard) génère un feu d'artifice + Cette commande (non standard) génère un feu d'artifice - si les quatre lettres sont valides, le feu d'artifice partira - au bout de quelques secondes + au bout de quelques secondes, - si les quatres lettres ne sont pas valides, la réaction magique - continuera pendant longtemps + continuera pendant longtemps. Contrôle-c (aussi noté ^c) - appuyer sur les touches Contrôle et c en même temps interrompt + Appuyer sur les touches Contrôle et c en même temps interrompt la commande en cours en envoyant le signal INT ("INTerrupt") au - processus + processus. From f3e5e7a907c1b491e9e6219560786d40fa151448 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 29 Aug 2024 14:12:50 +0200 Subject: [PATCH 046/103] make the xeyes and cal missions skippable by default --- missions/index.txt | 46 ++++++++++--------- missions/intermediate/04_bg_xeyes/skip/en.txt | 4 ++ missions/intermediate/04_bg_xeyes/skip/fr.txt | 4 ++ missions/misc/01_cal_nostradamus/skip/en.txt | 4 ++ missions/misc/01_cal_nostradamus/skip/fr.txt | 4 ++ 5 files changed, 40 insertions(+), 22 deletions(-) create mode 100644 missions/intermediate/04_bg_xeyes/skip/en.txt create mode 100644 missions/intermediate/04_bg_xeyes/skip/fr.txt create mode 100644 missions/misc/01_cal_nostradamus/skip/en.txt create mode 100644 missions/misc/01_cal_nostradamus/skip/fr.txt diff --git a/missions/index.txt b/missions/index.txt index 01cddc073..428ceb7fc 100644 --- a/missions/index.txt +++ b/missions/index.txt @@ -1,22 +1,24 @@ -basic/index.txt -misc/01_cal_nostradamus -intermediate/01_alias_la -misc/02_nano_journal -intermediate/02_alias_journal -intermediate/03_tab_spider_lair -intermediate/04_bg_xeyes -intermediate/05_background -intermediate/06_control-C -!finding_files_maze/00_shared -finding_files_maze/01_ls_cd -finding_files_maze/02_tree -finding_files_maze/03_find_1 -pipe_intro_book_of_potions/index.txt -processes/index.txt -stdin_stdout_stderr/index.txt -permissions/index.txt -finding_files_maze/04_find_2 -finding_files_maze/05_find_xargs_grep -pipes_merchant_stall/index.txt -misc/03_tr_caesar_shift -FINAL_MISSION +# default Gameshell missions order + + basic/index.txt + misc/01_cal_nostradamus + intermediate/01_alias_la + misc/02_nano_journal + intermediate/02_alias_journal + intermediate/03_tab_spider_lair + intermediate/04_bg_xeyes + intermediate/05_background + intermediate/06_control-C + !finding_files_maze/00_shared + finding_files_maze/01_ls_cd + finding_files_maze/02_tree + finding_files_maze/03_find_1 + pipe_intro_book_of_potions/index.txt + processes/index.txt + stdin_stdout_stderr/index.txt + permissions/index.txt + finding_files_maze/04_find_2 + finding_files_maze/05_find_xargs_grep + pipes_merchant_stall/index.txt + misc/03_tr_caesar_shift + FINAL_MISSION diff --git a/missions/intermediate/04_bg_xeyes/skip/en.txt b/missions/intermediate/04_bg_xeyes/skip/en.txt new file mode 100644 index 000000000..8f8cf2583 --- /dev/null +++ b/missions/intermediate/04_bg_xeyes/skip/en.txt @@ -0,0 +1,4 @@ +This mission is optionnal. You can skip it and go to the next one with the +command + + $ gsh skip diff --git a/missions/intermediate/04_bg_xeyes/skip/fr.txt b/missions/intermediate/04_bg_xeyes/skip/fr.txt new file mode 100644 index 000000000..a1ca28f61 --- /dev/null +++ b/missions/intermediate/04_bg_xeyes/skip/fr.txt @@ -0,0 +1,4 @@ +Cette mission est facultative. Vous pouvez l'ignorer et passer à la suivante +avec la commande + + $ gsh skip diff --git a/missions/misc/01_cal_nostradamus/skip/en.txt b/missions/misc/01_cal_nostradamus/skip/en.txt new file mode 100644 index 000000000..8f8cf2583 --- /dev/null +++ b/missions/misc/01_cal_nostradamus/skip/en.txt @@ -0,0 +1,4 @@ +This mission is optionnal. You can skip it and go to the next one with the +command + + $ gsh skip diff --git a/missions/misc/01_cal_nostradamus/skip/fr.txt b/missions/misc/01_cal_nostradamus/skip/fr.txt new file mode 100644 index 000000000..a1ca28f61 --- /dev/null +++ b/missions/misc/01_cal_nostradamus/skip/fr.txt @@ -0,0 +1,4 @@ +Cette mission est facultative. Vous pouvez l'ignorer et passer à la suivante +avec la commande + + $ gsh skip From f55660e143eff26dfc44df1ff09d83cf960638b4 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 29 Aug 2024 14:27:55 +0200 Subject: [PATCH 047/103] show skipable missions in gsh index --- i18n/en.po | 3 +++ i18n/fr.po | 3 +++ i18n/it.po | 3 +++ i18n/template.pot | 3 +++ scripts/_gsh_index | 16 +++++++++++----- 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index 5a673fcb4..b5948f90a 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -283,6 +283,9 @@ msgstr[1] "game time: %s in %d sessions" msgid "n" msgstr "n" +msgid "optional" +msgstr "optional" + msgid "password:" msgstr "password:" diff --git a/i18n/fr.po b/i18n/fr.po index 1f36739c6..e4f357a9f 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -290,6 +290,9 @@ msgstr[1] "temps de jeu : %s en %d sessions" msgid "n" msgstr "n" +msgid "optional" +msgstr "facultatif" + msgid "password:" msgstr "mot de passe :" diff --git a/i18n/it.po b/i18n/it.po index aed99ffdf..908e78b99 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -298,6 +298,9 @@ msgstr[1] "tempo di gioco: %s in %d sessioni" msgid "n" msgstr "n" +msgid "optional" +msgstr "facoltativo" + msgid "password:" msgstr "password:" diff --git a/i18n/template.pot b/i18n/template.pot index 0c0c03fc7..81f5f76a6 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -266,6 +266,9 @@ msgstr[1] "" msgid "n" msgstr "" +msgid "optional" +msgstr "" + msgid "password:" msgstr "" diff --git a/scripts/_gsh_index b/scripts/_gsh_index index c20f0890d..073de68d2 100755 --- a/scripts/_gsh_index +++ b/scripts/_gsh_index @@ -11,22 +11,28 @@ do continue fi + SKIPABLE="" + if [ -f "$GSH_MISSIONS/$mission_dir/skip.txt" ] || [ -d "$GSH_MISSIONS/$mission_dir/skip" ] + then + SKIPABLE=" [$(gettext "optional")]" + fi + if grep -q "^$n CHECK_OK" "$GSH_CONFIG/missions.log" then COLOR="green" - STATUS=" ($(gettext "completed"))" + STATUS=" ($(gettext "completed"))" elif grep -q "^$n CHECK_OOPS" "$GSH_CONFIG/missions.log" then COLOR="red" - STATUS=" ($(gettext "failed"))" + STATUS=" ($(gettext "failed"))" elif grep -q "^$n SKIP" "$GSH_CONFIG/missions.log" then COLOR="yellow" - STATUS=" ($(gettext "skipped"))" + STATUS=" ($(gettext "skipped"))" elif grep -q "^$n CANCEL_DEP_PB" "$GSH_CONFIG/missions.log" then COLOR="magenta" - STATUS=" ($(gettext "cancelled"))" + STATUS=" ($(gettext "cancelled"))" else COLOR="white" STATUS="" @@ -39,7 +45,7 @@ do fi printf "%s%2d " "$LEAD" "$n" - color_echo "$COLOR" "$mission_dir$STATUS" + color_echo "$COLOR" "$mission_dir$SKIPABLE$STATUS" n="$((n + 1))" done < "$GSH_CONFIG/index.txt" | pager From c75c2e713726806c84a6497f5941c1bcf3f13870 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 28 Aug 2024 14:49:18 +0200 Subject: [PATCH 048/103] reset to current mission when next mission isn't found --- lib/gsh.sh | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/gsh.sh b/lib/gsh.sh index 69bd86fb8..a884fda21 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -44,7 +44,7 @@ __log_action() { _gsh_reset() { - local MISSION_NB="$(_gsh_pcm)" + local MISSION_NB="${1:-$(_gsh_pcm)}" if [ -z "$MISSION_NB" ] then local fn_name="${FUNCNAME[0]}" @@ -226,11 +226,10 @@ __gsh_start() { color_echo red "$(eval_gettext "Error: mission \$MISSION_NB doesn't exist!")" >&2 echo __log_action "$MISSION_NB" "UNKNOWN_MISSION" - gsh reset + gsh reset $(($MISSION_NB-1)) # reset the previous (current) mission return 1 fi - # re-source static.sh, in case some important directory was removed by accident [ -f "$MISSION_DIR/static.sh" ] && mission_source "$MISSION_DIR/static.sh" @@ -671,8 +670,8 @@ gsh() { ;; "reset") export GSH_LAST_ACTION='reset' - __gsh_clean - _gsh_reset + __gsh_clean "$1" + _gsh_reset "$1" ;; "resetstatic") _gsh_resetstatic From 7a7a2ca308bf38065b639117ee35e9ac3cfda89e Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 28 Aug 2024 16:09:28 +0200 Subject: [PATCH 049/103] adding the possibility of having several index files in the same archive $./utils/archive.sh -I index-short.txt -I index-all.txt MISSIONS will generate a standalone archive with 3 index files (and all the necessary missions): - index.txt, containing all the MISSIONS given as arguments - index-short.txt, containing the missions from index-short.txt - index-all.txt, containing the missions from index-all.txt You can choose which index file to use when starting a Gameshell instance: $ ./gameshell.sh or equivalently $ ./gameshell.sh index.txt uses index.txt and $ ./gameshell.sh index-short.txt uses index-short.txt --- scripts/make_index | 13 ++++-- utils/archive.sh | 113 ++++++++++++++++++++++++++++----------------- 2 files changed, 80 insertions(+), 46 deletions(-) diff --git a/scripts/make_index b/scripts/make_index index 37cd4f896..ce8dbfe5a 100755 --- a/scripts/make_index +++ b/scripts/make_index @@ -113,11 +113,18 @@ make_index() { # without argument, use the default index file parse_index "$GSH_MISSIONS/index.txt" || exit 1 return 0 - # when given a directory containing either a "bin" directory or a - # "static.sh" script, this is a dummy mission. Just print the path - # prefixed with a "!" fi + if [ "$#" -eq 1 ] && [ -f "$GSH_MISSIONS/$1" ] + then + # with a single file argument, we assume it is an index file + parse_index "$GSH_MISSIONS/$1" || exit 1 + return 0 + fi + + # otherwise, parse each mission / index file from the arguments + # (Note, it should not be used from a GameShell instance, but only directly + # from ``start.sh`` or from ``utils/archive.sh`` while [ "$#" -gt 0 ] do MISSION_DIR=$(readlink-f "$1") diff --git a/utils/archive.sh b/utils/archive.sh index 9781601f9..8cf18e88a 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -19,6 +19,8 @@ options: and not using gettext -N ... name of the archive / top directory (default: "gameshell") + -I FILE additional existing index file to include + (can be given several times) -S simple -S index @@ -60,9 +62,11 @@ GENERATE_MO=1 KEEP_PO=0 # this is set to 1 if we generate .mo files. Setting it to 1 here # (or before generating .mo files) will keep the .po files LANGUAGES="" -VERBOSE= +VERBOSE="" -while getopts "hp:N:atPzL:EvS:p:" opt +INDEX_FILES="" + +while getopts "hp:N:atPzL:EvS:p:I:" opt do case $opt in h) @@ -86,6 +90,14 @@ do ;; esac ;; + I) + if [ "$OPTARG" = "index.txt" ] + then + echo "Warning: ignoring additional index file with name 'index.txt'" + else + INDEX_FILES="INDEX_FILES:$OPTARG" + fi + ;; a) KEEP_AUTO=1 ;; @@ -146,15 +158,7 @@ mkdir "$TMP_DIR/$NAME" # use POSIX options to make sure it is portable cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$TMP_DIR/$NAME" -# copy missions mkdir "$TMP_DIR/$NAME/missions" -if [ -z "$VERBOSE" ] -then - printf "copying missions: " -else - echo "copying missions" -fi - if ! make_index "$@" > "$TMP_DIR/$NAME/missions/index.txt" then echo "Error: archive.sh, couldn't make index.txt" @@ -164,44 +168,67 @@ then exit 1 fi -NB_MISSIONS=0 -NB_DUMMY=0 -cat "$TMP_DIR/$NAME/missions/index.txt" | while read MISSION_DIR +# copy missions +if [ -z "$VERBOSE" ] +then + printf "copying missions: " +else + echo "copying missions" +fi + +# NB_MISSIONS=0 +# NB_DUMMY=0 +ALL_INDEX_FILES="$TMP_DIR/$NAME/missions/index.txt" +IFS=: +for FILE in $INDEX_FILES do - DUMMY= - case $MISSION_DIR in - "" | "#"* ) - continue - ;; - "!"*) - MISSION_DIR=$(echo "$MISSION_DIR" | cut -c2-) - NB_DUMMY=$((NB_DUMMY + 1)) - DUMMY=1 - ;; - esac - NB_MISSIONS=$((NB_MISSIONS + 1)) - if [ -z "$VERBOSE" ] - then - if [ -z "$DUMMY" ] - then - printf "." - else - printf "!" - fi - else - if [ -z "$DUMMY" ] + cp "$FILE" "$TMP_DIR/$NAME/missions/$(basename "$FILE")" + ALL_INDEX_FILES="$ALL_INDEX_FILES:$TMP_DIR/$NAME/missions/$(basename "$FILE")" +done + +for FILE in $ALL_INDEX_FILES +do + cat "$FILE" | while read MISSION_DIR + do + DUMMY= + case $MISSION_DIR in + "" | "#"* ) + continue + ;; + "!"*) + MISSION_DIR=$(echo "$MISSION_DIR" | cut -c2-) + # NB_DUMMY=$((NB_DUMMY + 1)) + DUMMY=1 + ;; + esac + # NB_MISSIONS=$((NB_MISSIONS + 1)) + if [ -z "$VERBOSE" ] then - echo " - $MISSION_DIR" + if [ -z "$DUMMY" ] + then + printf "." + else + printf "!" + fi else - echo " ! $MISSION_DIR (dummy)" + if [ -z "$DUMMY" ] + then + echo " - $MISSION_DIR" + else + echo " ! $MISSION_DIR (dummy)" + fi fi - fi - mkdir -p "$TMP_DIR/$NAME/missions/$MISSION_DIR" - ARCHIVE_MISSION_DIR=$TMP_DIR/$NAME/missions/$MISSION_DIR - # NOTE: macOS' cp doesn't have '--archive', and '-a' is not POSIX. - # use POSIX options to make sure it is portable - cp -RPp "$GSH_MISSIONS/$MISSION_DIR"/* "$ARCHIVE_MISSION_DIR" + mkdir -p "$TMP_DIR/$NAME/missions/$MISSION_DIR" + ARCHIVE_MISSION_DIR=$TMP_DIR/$NAME/missions/$MISSION_DIR + # NOTE: macOS' cp doesn't have '--archive', and '-a' is not POSIX. + # use POSIX options to make sure it is portable + cp -RPp "$GSH_MISSIONS/$MISSION_DIR"/* "$ARCHIVE_MISSION_DIR" + done done + +# reset IFS +unset IFS + [ -n "$VERBOSE" ] || echo # define new GSH_ROOT From 50ddd2741afb99e2dfc1e4896c9cbb0a7cfb16da Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 10:34:06 +0100 Subject: [PATCH 050/103] spelling --- scripts/_gsh_index | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/_gsh_index b/scripts/_gsh_index index 073de68d2..4b3ba8e5f 100755 --- a/scripts/_gsh_index +++ b/scripts/_gsh_index @@ -11,10 +11,10 @@ do continue fi - SKIPABLE="" + SKIPPABLE="" if [ -f "$GSH_MISSIONS/$mission_dir/skip.txt" ] || [ -d "$GSH_MISSIONS/$mission_dir/skip" ] then - SKIPABLE=" [$(gettext "optional")]" + SKIPPABLE=" [$(gettext "optional")]" fi if grep -q "^$n CHECK_OK" "$GSH_CONFIG/missions.log" @@ -45,7 +45,7 @@ do fi printf "%s%2d " "$LEAD" "$n" - color_echo "$COLOR" "$mission_dir$SKIPABLE$STATUS" + color_echo "$COLOR" "$mission_dir$SKIPPABLE$STATUS" n="$((n + 1))" done < "$GSH_CONFIG/index.txt" | pager From 856a3ad1a851ef1221ceeec332a062c335321ad1 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 16:28:32 +0100 Subject: [PATCH 051/103] updated gitignore file --- .gitignore | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 07cf065e2..cf9eb3a8e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +Images/gsh-*-orig.gif tmp TODO .bin @@ -8,8 +9,6 @@ TODO World locale/ *~ -gameshell.sh -gameshell-save.sh -gameshell.tgz -boxes-data.awk +gameshell* game shell* +boxes-data.awk From aec2e809893db2677301e92db06e3d34420f363c Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 16:44:27 +0100 Subject: [PATCH 052/103] automatic testing did not test the last missions! --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 7c4e3f49f..2296c78a9 100644 --- a/Makefile +++ b/Makefile @@ -37,22 +37,22 @@ new: i18n/template.pot ## check that the auto.sh scripts work as expected check: clean ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -q -c 'gsh systemconfig; for _ in $$(seq 42); do gsh auto --abort < <(echo gsh); done; gsh stat' + ./"game shell (1).sh" -q -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort < <(echo gsh); done; gsh stat' ## check that the auto.sh scripts work as expected, in verbose mode check-verbose: clean ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Dq -c 'gsh systemconfig; for _ in $$(seq 42); do gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -Dq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort; done; gsh stat' ## run all the test.sh and auto.sh scripts tests-bash: clean ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Bdq -c 'gsh systemconfig; for _ in $$(seq 42); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' ## run all the test.sh and auto.sh scripts tests-zsh: clean ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 42); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' clean: rm -rf i18n/*~ locale gameshell gameshell.tar gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk From 26e6ac8104ed1d22fe132cbe234ad2326a912ec2 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 16:21:10 +0100 Subject: [PATCH 053/103] additional messages for the pyrotechnician's missions --- missions/intermediate/05_background/check.sh | 6 +- .../intermediate/05_background/i18n/en.po | 3 + .../intermediate/05_background/i18n/fr.po | 3 + .../intermediate/05_background/i18n/it.po | 58 ++++++------- .../05_background/i18n/template.pot | 3 + .../intermediate/06_control-C/Charmiglio.sh | 12 ++- missions/intermediate/06_control-C/i18n/en.po | 3 + missions/intermediate/06_control-C/i18n/fr.po | 3 + missions/intermediate/06_control-C/i18n/it.po | 81 +++++++++---------- .../06_control-C/i18n/template.pot | 3 + 10 files changed, 103 insertions(+), 72 deletions(-) diff --git a/missions/intermediate/05_background/check.sh b/missions/intermediate/05_background/check.sh index 1784da88b..c316c2542 100644 --- a/missions/intermediate/05_background/check.sh +++ b/missions/intermediate/05_background/check.sh @@ -14,12 +14,12 @@ _check() { if [ ! -f "$PIDS" ] then echo "$(gettext "Mmm... I didn't see anything.")" + echo + echo "$(gettext "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting.")" return 1 fi NB=$(cat "$PIDS" | wc -l) - cat $PIDS - echo "NB = '$NB'" if [ "$NB" -ge 3 ] then echo "$(gettext "Great, that looked good!")" @@ -27,6 +27,8 @@ _check() { elif [ "$NB" -lt 3 ] then echo "$(eval_gettext "Mmm... I only saw \$NB fireworks. That's not enough.")" + echo + echo "$(gettext "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting.")" return 1 else echo "you shouldn't see this!" diff --git a/missions/intermediate/05_background/i18n/en.po b/missions/intermediate/05_background/i18n/en.po index e9081ea2e..d02300ea1 100644 --- a/missions/intermediate/05_background/i18n/en.po +++ b/missions/intermediate/05_background/i18n/en.po @@ -30,5 +30,8 @@ msgstr "Mmm... I didn't see anything." msgid "Mmm... I only saw $NB fireworks. That's not enough." msgstr "Mmm... I only saw $NB fireworks. That's not enough." +msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." +msgstr "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." + msgid "charmiglio" msgstr "charmiglio" diff --git a/missions/intermediate/05_background/i18n/fr.po b/missions/intermediate/05_background/i18n/fr.po index 5347729e3..ccbb8b136 100644 --- a/missions/intermediate/05_background/i18n/fr.po +++ b/missions/intermediate/05_background/i18n/fr.po @@ -29,5 +29,8 @@ msgstr "Mmm... Je n'ai rien vu." msgid "Mmm... I only saw $NB fireworks. That's not enough." msgstr "Mmm... Je n'ai vu que $NB feux d'artifices. Ce n'est pas assez." +msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." +msgstr "NOTE : vous devez vous débrouiller pour que l'artificier voie tous les feux d'artifice pendant qu'il attend." + msgid "charmiglio" msgstr "charmiglio" diff --git a/missions/intermediate/05_background/i18n/it.po b/missions/intermediate/05_background/i18n/it.po index ecc03ae96..01d86cfb6 100644 --- a/missions/intermediate/05_background/i18n/it.po +++ b/missions/intermediate/05_background/i18n/it.po @@ -1,44 +1,46 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT # mte90 , 2024. -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: mte90 \n" -"PO-Revision-Date: 2024-08-29 13:53+0200\n" -"Project-Id-Version: \n" -"Language-Team: Italian \n" -"Language: it_IT\n" -"MIME-Version: 1.0\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 22.12.3\n" +msgid "" +msgstr "Project-Id-Version: \n" + "PO-Revision-Date: 2024-08-29 13:53+0200\n" + "Last-Translator: mte90 \n" + "Language-Team: Italian \n" + "Language: it_IT\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + "X-Generator: Lokalize 22.12.3\n" # path for the text file containing the goal #, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" -msgid "Great, that looked good!" -msgstr "Ottimo, sembra tutto a posto!" +msgid "Great, that looked good!" +msgstr "Ottimo, sembra tutto a posto!" -msgid "Let's have a look:" -msgstr "Vediamo insieme:" +msgid "Let's have a look:" +msgstr "Vediamo insieme:" #, sh-format -msgid "Mmm... I didn't see anything." -msgstr "Mmm... non vedo niente." +msgid "Mmm... I didn't see anything." +msgstr "Mmm... non vedo niente." #, sh-format -msgid "Mmm... I only saw $NB fireworks. That's not enough." -msgstr "Mmm... io vedo solo $NB fuochi d'artificio. Non sono sufficenti." +msgid "Mmm... I only saw $NB fireworks. That's not enough." +msgstr "Mmm... io vedo solo $NB fuochi d'artificio. Non sono sufficenti." -msgid "charmiglio" -msgstr "charmiglio" +msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." +msgstr "" + +msgid "charmiglio" +msgstr "charmiglio" diff --git a/missions/intermediate/05_background/i18n/template.pot b/missions/intermediate/05_background/i18n/template.pot index b96ab1952..8f71731b3 100644 --- a/missions/intermediate/05_background/i18n/template.pot +++ b/missions/intermediate/05_background/i18n/template.pot @@ -29,5 +29,8 @@ msgstr "" msgid "Mmm... I only saw $NB fireworks. That's not enough." msgstr "" +msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." +msgstr "" + msgid "charmiglio" msgstr "" diff --git a/missions/intermediate/06_control-C/Charmiglio.sh b/missions/intermediate/06_control-C/Charmiglio.sh index 31edfa945..28755184f 100755 --- a/missions/intermediate/06_control-C/Charmiglio.sh +++ b/missions/intermediate/06_control-C/Charmiglio.sh @@ -48,7 +48,17 @@ magical_reaction() { i=1 fi alpha=$(echo "#%*():_-............." | awk "{print substr(\$0, $i<10?$i:10, 10)}" ) - printf "%*s%s\n" "$indent" '' "$(random_string "$width" "$alpha")" >&2 + printf "%*s%s" "$indent" '' "$(random_string "$width" "$alpha")" >&2 + if [ "$delay" -gt 2 ] && [ "$((delay % 10))" -eq 0 ] && [ "$show_msg" != 0 ] + then + printf "\t\t$(gettext "You can stop the incantation with Control-c.")" + show_msg=0 + fi + if [ "$((delay % 10))" -eq 1 ] + then + show_msg=1 + fi + echo sleep 0.1 done } diff --git a/missions/intermediate/06_control-C/i18n/en.po b/missions/intermediate/06_control-C/i18n/en.po index a9a48bdc4..b40f80efe 100644 --- a/missions/intermediate/06_control-C/i18n/en.po +++ b/missions/intermediate/06_control-C/i18n/en.po @@ -42,6 +42,9 @@ msgstr "Too soon! You must leave enough time for the magical reaction to start! msgid "What's a valid 4 letters sequence?" msgstr "What's a valid 4 letters sequence?" +msgid "You can stop the incantation with Control-c." +msgstr "You can stop the incantation with Control-c." + #, sh-format msgid "usage: $command CCCC\n" " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/fr.po b/missions/intermediate/06_control-C/i18n/fr.po index 48a249ed7..d0346d7a8 100644 --- a/missions/intermediate/06_control-C/i18n/fr.po +++ b/missions/intermediate/06_control-C/i18n/fr.po @@ -41,6 +41,9 @@ msgstr "Trop tôt ! Vous devez laisser assez de temps pour que la réaction mag msgid "What's a valid 4 letters sequence?" msgstr "Qu'est-ce qu'une combinaison valide ?" +msgid "You can stop the incantation with Control-c." +msgstr "Vous pouvez arêter l'incantation avec Contrôle-c" + #, sh-format msgid "usage: $command CCCC\n" " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/it.po b/missions/intermediate/06_control-C/i18n/it.po index 897dd2291..c17f3e6d3 100644 --- a/missions/intermediate/06_control-C/i18n/it.po +++ b/missions/intermediate/06_control-C/i18n/it.po @@ -1,62 +1,61 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT # mte90 , 2024. -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: mte90 \n" -"PO-Revision-Date: 2024-08-29 14:05+0200\n" -"Project-Id-Version: \n" -"Language-Team: Italian \n" -"Language: it_IT\n" -"MIME-Version: 1.0\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 22.12.3\n" +msgid "" +msgstr "Project-Id-Version: \n" + "PO-Revision-Date: 2024-08-29 14:05+0200\n" + "Last-Translator: mte90 \n" + "Language-Team: Italian \n" + "Language: it_IT\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + "X-Generator: Lokalize 22.12.3\n" # path for the text file containing the goal #, sh-format -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "" -msgid "Charmiglio" -msgstr "Charmiglio" +msgid "Charmiglio" +msgstr "Charmiglio" #, sh-format -msgid "It works! The special incantation is $CODE" -msgstr "Funziona! L'incantesimo speciale è $CODE" +msgid "It works! The special incantation is $CODE" +msgstr "Funziona! L'incantesimo speciale è $CODE" -msgid "NOTE: you should interrupt the magical reaction after a few seconds!" -msgstr "NOTA: puoi interrompere la reazione magica dopo pochi secondi!" +msgid "NOTE: you should interrupt the magical reaction after a few seconds!" +msgstr "NOTA: puoi interrompere la reazione magica dopo pochi secondi!" -msgid "That's not working, try a different combination..." -msgstr "Non ha funzionato, prova una combinazione differente..." +msgid "That's not working, try a different combination..." +msgstr "Non ha funzionato, prova una combinazione differente..." -msgid "The incantation can only use ASCII letters." -msgstr "L'incantesimo può utilizzare solo caratteri ASCII." +msgid "The incantation can only use ASCII letters." +msgstr "L'incantesimo può utilizzare solo caratteri ASCII." -msgid "The incantation requires exactly 4 letters." -msgstr "L'incantesimo richiede esattamente 4 lettere." +msgid "The incantation requires exactly 4 letters." +msgstr "L'incantesimo richiede esattamente 4 lettere." #, sh-format -msgid "Too soon! You must leave enough time for the magical reaction to start!" -msgstr "" -"Troppo presto! Devi dare abbastanza tempo per l'avvio della reazione magica!" +msgid "Too soon! You must leave enough time for the magical reaction to start!" +msgstr "Troppo presto! Devi dare abbastanza tempo per l'avvio della reazione magica!" -msgid "What's a valid 4 letters sequence?" -msgstr "Cosa è una sequenza valida di 4 lettere?" +msgid "What's a valid 4 letters sequence?" +msgstr "Cosa è una sequenza valida di 4 lettere?" + +msgid "You can stop the incantation with Control-c." +msgstr "" #, sh-format -msgid "" -"usage: $command CCCC\n" -" where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" -msgstr "" -"uso: $command CCCC\n" -" dove CCCC è una sequenza di 4 caratteri ASCII (a-zA-Z)" +msgid "usage: $command CCCC\n" + " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" +msgstr "uso: $command CCCC\n" + " dove CCCC è una sequenza di 4 caratteri ASCII (a-zA-Z)" diff --git a/missions/intermediate/06_control-C/i18n/template.pot b/missions/intermediate/06_control-C/i18n/template.pot index 416128eea..883b8463c 100644 --- a/missions/intermediate/06_control-C/i18n/template.pot +++ b/missions/intermediate/06_control-C/i18n/template.pot @@ -41,6 +41,9 @@ msgstr "" msgid "What's a valid 4 letters sequence?" msgstr "" +msgid "You can stop the incantation with Control-c." +msgstr "" + #, sh-format msgid "usage: $command CCCC\n" " where CCCC is a sequence of 4 ASCII letters (a-zA-Z)" From e21e5775d986732d6d8fcfeca4443bdec63b13cd Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 11:23:56 +0100 Subject: [PATCH 054/103] removing empty directories and language text files in archive.sh also, wrong option for archive.sh documented in doc --- doc/gameshell.md | 13 ++++++------- utils/archive.sh | 30 ++++++++++++++++++++++++++---- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/doc/gameshell.md b/doc/gameshell.md index 5be9dfa89..4b107901f 100644 --- a/doc/gameshell.md +++ b/doc/gameshell.md @@ -139,14 +139,13 @@ You can customize the archive with the following options GameShell will ask for the player's name and email. This is useful in the classroom as it makes it easier to link a game to the corresponding student. (The player can run the archive in anonymous mode with the `-A` option.) -* `--password PASSWORD`: you can choose the admin password for the archive. +* `-p PASSWORD`: you can choose the admin password for the archive. This is also useful in the classroom as we might not want the students to learn of this password. :) -* `-a`: keep the automatic scripts. Some missions come with a script that - automagically completes the missions. By default, those scripts are **not** - included in the archive. Use `-a` if you want to keep them. * `-N NAME`: if you want the archive and its directory to be called something other than "GameShell", you can set the name with this option. -* `-k`: keep the GameShell archive. The compressed `tar` archive is appended - to a shell script to create the executable archive. With this option, you - can keep the "standard" `tar` archive as well as the executable one. + +More options are available and listed in the output of +```sh +$ ./utils/archive.sh -h +``` diff --git a/utils/archive.sh b/utils/archive.sh index 8cf18e88a..1b04206ce 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -26,6 +26,7 @@ options: -S index -S overwrite choose default savefile mode + (check the output of 'gameshell.sh -h' for their description) -a keep 'auto.sh' scripts for missions that have one -t keep 'test.sh' scripts for missions that have one @@ -95,7 +96,7 @@ do then echo "Warning: ignoring additional index file with name 'index.txt'" else - INDEX_FILES="INDEX_FILES:$OPTARG" + INDEX_FILES="$INDEX_FILES:$OPTARG" fi ;; a) @@ -182,6 +183,7 @@ ALL_INDEX_FILES="$TMP_DIR/$NAME/missions/index.txt" IFS=: for FILE in $INDEX_FILES do + [ -z "$FILE" ] && continue # ignore initial empty file due to leading ':' cp "$FILE" "$TMP_DIR/$NAME/missions/$(basename "$FILE")" ALL_INDEX_FILES="$ALL_INDEX_FILES:$TMP_DIR/$NAME/missions/$(basename "$FILE")" done @@ -246,7 +248,8 @@ fi # remove unwanted languages if [ -n "$LANGUAGES" ] then - echo "removing unwanted languages" + printf "removing unwanted languages: " + # remove po files find "$GSH_ROOT" -path "*/i18n/*.po" | while read -r po_file do if ! keep_language "${po_file%.po}" "$LANGUAGES" @@ -256,6 +259,25 @@ then rm --system -f "$po_file" fi done + + # remove translation text files for GameShell and standard translation text + # files for individual missions + for dir in "$GSH_ROOT/i18n"/* goal skip treasure-msg + do + dir=$(basename "$dir") + find "$GSH_ROOT" -path "*/$dir/*.txt" | while read -r txt_file + do + [ "$(basename "$txt_file")" = "en.txt" ] && continue + if ! keep_language "${txt_file%.txt}" "$LANGUAGES" + then + # --system makes GameShell use the standard rm utility instead of the "safe" + # rm implemented in scripts/rm + printf "." + rm --system -f "$txt_file" + fi + done + done + echo fi # generate .mo files @@ -320,10 +342,10 @@ echo "removing unnecessary files" find . -name "Makefile" | xargs rm --system -f find . -name "template.pot" | xargs rm --system -f [ "$KEEP_PO" -eq 0 ] && find . -name "*.po" | xargs rm --system -f + find . -name "i18n" | xargs rmdir 2> /dev/null [ "$KEEP_TEST" -ne 1 ] && find ./missions -name "test.sh" | xargs rm --system -f [ "$KEEP_AUTO" -ne 1 ] && find ./missions -name auto.sh | xargs rm --system -f - - # rm --system -f "$GSH_ROOT/scripts/boxes-data.awk" "$GSH_ROOT/utils/archive.sh" + rm --system -rf "$GSH_ROOT/utils/" ) # change admin password From b244934f625d378f69b893e87438b68210fd7b47 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 15:51:08 +0100 Subject: [PATCH 055/103] trying to get multiple index files working --- i18n/start-help/en.txt | 14 ++++++++++++-- i18n/start-help/fr.txt | 13 +++++++++++++ lib/gsh.sh | 2 +- scripts/_gsh_env | 1 + scripts/_gsh_index | 2 +- scripts/missiondir | 2 +- start.sh | 13 +++++++++---- utils/archive.sh | 42 ++++++++++++++++++++++++++++-------------- 8 files changed, 66 insertions(+), 23 deletions(-) diff --git a/i18n/start-help/en.txt b/i18n/start-help/en.txt index 2e52391ab..2635c752d 100644 --- a/i18n/start-help/en.txt +++ b/i18n/start-help/en.txt @@ -1,3 +1,13 @@ +usage: + $GSH_EXEC_FILE [OPTIONS] [INDEX_FILE1 INDEX_FILE2 ...] + +Possible values for INDEX_FILE are: $GSH_INDEX_FILES. + +If no INDEX_FILE is given, defaults to index.txt. + +Index files are ignored when continuing from a save file. + + options: -h this message -V display version @@ -13,8 +23,8 @@ options: -G do not use gettext for translation (everything will be in English) -L ... set LANGUAGE variable (ex: -L fr:it:en) - On non GNU systems, set the variable LC_MESSAGES - to a valid locale. + On non GNU systems, set the variable LC_MESSAGES to a valid locale. + This flag is ignored when continuing from a save file. -S simple the savefile is obtained by adding a "-save" suffix, diff --git a/i18n/start-help/fr.txt b/i18n/start-help/fr.txt index e7ab178e9..61d0971c0 100644 --- a/i18n/start-help/fr.txt +++ b/i18n/start-help/fr.txt @@ -1,3 +1,14 @@ +utilisation : + $GSH_EXEC_FILE [OPTIONS] [INDEX_FILE1 INDEX_FILE2 ...] + +Les valeurs possibles pour INDEX_FILE sont : $GSH_INDEX_FILES. + +Si aucun INDEX_FILE n'est donné, utilise index.txt par défaut. + +Les fichier index sont ignorés lorsqu'on reprend une session à partir d'un +fichier de sauvegarde. + + options : -h ce message -V affiche la version @@ -16,6 +27,8 @@ options : -L initialise la variable LANGUAGE (ex : -L fr:it:en) Pour les systèmes non GNU, initialisez la variable LC_MESSAGES avec une locale valide. + Cette option est sans effet lorsqu'on reprend une session à partir + d'un fichier de sauvegarde. -S simple le fichier de sauvegarde est obtenu en ajoutant un suffix "-save", diff --git a/lib/gsh.sh b/lib/gsh.sh index a884fda21..e3b8f4ecd 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -119,7 +119,7 @@ _gsh_resetstatic() { printf "." >&2 fi - done < "$GSH_CONFIG/index.txt" + done < "$GSH_CONFIG/current_index.txt" echo "" >&2 unset MISSION_DIR DOMAIN diff --git a/scripts/_gsh_env b/scripts/_gsh_env index 24edc0357..be71fb81c 100755 --- a/scripts/_gsh_env +++ b/scripts/_gsh_env @@ -5,6 +5,7 @@ echo "=========================" echo " GSH_EXEC_FILE=$GSH_EXEC_FILE" echo " GSH_EXEC_DIR=$GSH_EXEC_DIR" echo " GSH_WORKING_DIR=$GSH_WORKING_DIR" +echo " GSH_INDEX_FILES=$GSH_INDEX_FILES" echo "=========================" echo " GSH_AUTOSAVE=$GSH_AUTOSAVE" echo " GSH_SAVEFILE_MODE=$GSH_SAVEFILE_MODE" diff --git a/scripts/_gsh_index b/scripts/_gsh_index index 4b3ba8e5f..cd578bc57 100755 --- a/scripts/_gsh_index +++ b/scripts/_gsh_index @@ -48,4 +48,4 @@ do color_echo "$COLOR" "$mission_dir$SKIPPABLE$STATUS" n="$((n + 1))" -done < "$GSH_CONFIG/index.txt" | pager +done < "$GSH_CONFIG/current_index.txt" | pager diff --git a/scripts/missiondir b/scripts/missiondir index f2a80117d..8142f3aa9 100755 --- a/scripts/missiondir +++ b/scripts/missiondir @@ -12,7 +12,7 @@ fi # get the mission directory n=$1 -dir=$(awk -v n="$n" -v DIR="$GSH_MISSIONS" '/^\s*[#!]/{next} /^$/{next} {N++} (N == n){print DIR "/" $0; exit}' "$GSH_CONFIG/index.txt") +dir=$(awk -v n="$n" -v DIR="$GSH_MISSIONS" '/^\s*[#!]/{next} /^$/{next} {N++} (N == n){print DIR "/" $0; exit}' "$GSH_CONFIG/current_index.txt") if [ -z "$dir" ] then echo "Error: missiondir, mission '$n' not found." >&2 diff --git a/start.sh b/start.sh index 7623831c6..b753feb80 100755 --- a/start.sh +++ b/start.sh @@ -25,10 +25,15 @@ export GSH_ROOT="$(dirname "$0")" . "$GSH_ROOT/lib/mission_source.sh" display_help() { - cat "$(eval_gettext "\$GSH_ROOT/i18n/start-help/en.txt")" + sed -e "s/\$GSH_EXEC_FILE/$GSH_EXEC_FILE/" \ + -e "s/\$GSH_INDEX_FILES/$(echo "$GSH_INDEX_FILES" | sed "s/:/, /g")/" \ + "$(eval_gettext "\$GSH_ROOT/i18n/start-help/en.txt")" } +# list of index files (default: only index.txt) +export GSH_INDEX_FILES=index.txt + # possible values: index, simple (default), overwrite export GSH_SAVEFILE_MODE="simple" export GSH_AUTOSAVE=1 @@ -198,7 +203,7 @@ progress() { if [ -z "$progress_I" ] then progress_filename=$GSH_ROOT/lib/ascii-art/titlescreen - local N=$(wc -l "$GSH_CONFIG/index.txt" | awk '{print $1}') + local N=$(wc -l "$GSH_CONFIG/current_index.txt" | awk '{print $1}') local size=$(wc -c "$progress_filename" | awk '{print $1}') progress_delta=$((size/N + 1)) # head -c$((progress_delta - 1)) $progress_filename => not POSIX compliant @@ -339,7 +344,7 @@ Do you want to remove it and start a new game? [y/N]') " clear fi - make_index "$@" | sed -e "s;$GSH_MISSIONS;.;" > "$GSH_CONFIG/index.txt" + make_index "$@" | sed -e "s;$GSH_MISSIONS;.;" > "$GSH_CONFIG/current_index.txt" if [ "$GSH_MODE" != "DEBUG" ] then @@ -449,7 +454,7 @@ Do you want to remove it and start a new game? [y/N]') " [ -z "$MISSION_SUB_NB" ] && MISSION_NB=$((MISSION_NB+1)) - done < "$GSH_CONFIG/index.txt" + done < "$GSH_CONFIG/current_index.txt" if [ "$MISSION_NB" -eq 1 ] then echo "$(gettext "Error: no mission was found! diff --git a/utils/archive.sh b/utils/archive.sh index 1b04206ce..a2272fa58 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -19,7 +19,7 @@ options: and not using gettext -N ... name of the archive / top directory (default: "gameshell") - -I FILE additional existing index file to include + -I FILE additional index file to include in the archive (can be given several times) -S simple @@ -92,9 +92,9 @@ do esac ;; I) - if [ "$OPTARG" = "index.txt" ] + if [ "$OPTARG" = "index.txt" ] || [ "$OPTARG" = "current_index.txt" ] then - echo "Warning: ignoring additional index file with name 'index.txt'" + echo "Warning: ignoring additional index file with name '$OPTARG'" else INDEX_FILES="$INDEX_FILES:$OPTARG" fi @@ -159,6 +159,9 @@ mkdir "$TMP_DIR/$NAME" # use POSIX options to make sure it is portable cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$TMP_DIR/$NAME" + +# generate default index file +ALL_INDEX_FILES=index.txt mkdir "$TMP_DIR/$NAME/missions" if ! make_index "$@" > "$TMP_DIR/$NAME/missions/index.txt" then @@ -169,7 +172,25 @@ then exit 1 fi +# generate additional index files +IFS=: +for FILE in $INDEX_FILES +do + [ -z "$FILE" ] && continue # ignore initial empty file due to leading ':' + ALL_INDEX_FILES="$ALL_INDEX_FILES:$(basename "$FILE")" + if ! make_index "$FILE" > "$TMP_DIR/$NAME/missions/$(basename "$FILE")" + then + echo "Error: archive.sh, couldn't make $(basename "$FILE")" + # --system makes GameShell use the standard rm utility instead of the "safe" + # rm implemented in scripts/rm + rm --system -rf "$TMP_DIR" + exit 1 + fi +done + # copy missions +# NB_MISSIONS=0 +# NB_DUMMY=0 if [ -z "$VERBOSE" ] then printf "copying missions: " @@ -177,19 +198,9 @@ else echo "copying missions" fi -# NB_MISSIONS=0 -# NB_DUMMY=0 -ALL_INDEX_FILES="$TMP_DIR/$NAME/missions/index.txt" -IFS=: -for FILE in $INDEX_FILES -do - [ -z "$FILE" ] && continue # ignore initial empty file due to leading ':' - cp "$FILE" "$TMP_DIR/$NAME/missions/$(basename "$FILE")" - ALL_INDEX_FILES="$ALL_INDEX_FILES:$TMP_DIR/$NAME/missions/$(basename "$FILE")" -done - for FILE in $ALL_INDEX_FILES do + FILE="$TMP_DIR/$NAME/missions/$FILE" cat "$FILE" | while read MISSION_DIR do DUMMY= @@ -239,6 +250,9 @@ export GSH_ROOT="$TMP_DIR/$NAME" export GSH_MISSIONS="$GSH_ROOT/missions" +sed-i "s/^export GSH_INDEX_FILES=.*/export GSH_INDEX_FILES=$ALL_INDEX_FILES/" "$GSH_ROOT/start.sh" + + # default GSH_NO_GETTEXT to 1 if -E was used if [ -n "$GSH_NO_GETTEXT" ] then From dd2e286f70a98e888bd33ba22d231b6f62b9554c Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 4 Nov 2024 16:45:46 +0100 Subject: [PATCH 056/103] minor change to always generate a "latest" archive --- .github/workflows/latest_game_archive.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/latest_game_archive.yml b/.github/workflows/latest_game_archive.yml index fa5c7f811..3205b5650 100644 --- a/.github/workflows/latest_game_archive.yml +++ b/.github/workflows/latest_game_archive.yml @@ -4,12 +4,12 @@ on: push: branches: - "master" - tags-ignore: - - "*" jobs: pre-release: + name: "latest release" runs-on: "ubuntu-latest" + steps: - name: "Checkout source code" uses: "actions/checkout@v4" From ed52aebb733368a44459ee1d36ee3e3951003d84 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 11:35:18 +0100 Subject: [PATCH 057/103] only display small help message with -h to get the full list of options, use -H instead --- i18n/en.po | 7 +++++ i18n/fr.po | 7 +++++ i18n/it.po | 7 +++++ i18n/start-full-help/en.txt | 50 ++++++++++++++++++++++++++++++++++++ i18n/start-full-help/fr.txt | 51 +++++++++++++++++++++++++++++++++++++ i18n/start-full-help/it.txt | 40 +++++++++++++++++++++++++++++ i18n/start-help/en.txt | 30 ++-------------------- i18n/start-help/fr.txt | 27 ++------------------ i18n/start-help/it.txt | 27 -------------------- i18n/template.pot | 7 +++++ lib/header.sh | 4 +-- start.sh | 19 ++++++++++++-- 12 files changed, 192 insertions(+), 84 deletions(-) create mode 100644 i18n/start-full-help/en.txt create mode 100644 i18n/start-full-help/fr.txt create mode 100644 i18n/start-full-help/it.txt diff --git a/i18n/en.po b/i18n/en.po index b5948f90a..397549b7b 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -19,6 +19,10 @@ msgstr "$GSH_ROOT/i18n/gameshell-init-msg/en.txt" msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" msgstr "$GSH_ROOT/i18n/gameshell-welcome/en.txt" +#, sh-format +msgid "$GSH_ROOT/i18n/start-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/start-full-help/en.txt" + #, sh-format msgid "$GSH_ROOT/i18n/start-help/en.txt" msgstr "$GSH_ROOT/i18n/start-help/en.txt" @@ -76,6 +80,9 @@ msgstr[1] "%d missions skipped:" msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" msgstr "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" +msgid "Available index files: " +msgstr "Available index files: " + #, sh-format msgid "Congratulations, mission $MISSION_NB has been successfully completed!" msgstr "Congratulations, mission $MISSION_NB has been successfully completed!" diff --git a/i18n/fr.po b/i18n/fr.po index e4f357a9f..3dc605b73 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -23,6 +23,10 @@ msgstr "$GSH_ROOT/i18n/gameshell-init-msg/fr.txt" msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" msgstr "$GSH_ROOT/i18n/gameshell-welcome/fr.txt" +#, sh-format +msgid "$GSH_ROOT/i18n/start-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/start-full-help/fr.txt" + #, sh-format msgid "$GSH_ROOT/i18n/start-help/en.txt" msgstr "$GSH_ROOT/i18n/start-help/fr.txt" @@ -80,6 +84,9 @@ msgstr[1] "%d missions sautées :" msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" msgstr "AUTOMATIQUEMENT GÉNÉRÉ AU DÉMARRAGE -- NE PAS MODIFIER" +msgid "Available index files: " +msgstr "Fichiers index disponibles: " + #, sh-format msgid "Congratulations, mission $MISSION_NB has been successfully completed!" msgstr "Bravo, vous avez réussi la mission $MISSION_NB !" diff --git a/i18n/it.po b/i18n/it.po index 908e78b99..4269b1b71 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -33,6 +33,10 @@ msgstr "$GSH_ROOT/i18n/gameshell-init-msg/it.txt" msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" msgstr "$GSH_ROOT/i18n/gameshell-welcome/it.txt" +#, sh-format +msgid "$GSH_ROOT/i18n/start-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/start-full-help/it.txt" + #, sh-format msgid "$GSH_ROOT/i18n/start-help/en.txt" msgstr "$GSH_ROOT/i18n/start-help/it.txt" @@ -90,6 +94,9 @@ msgstr[1] "%d missioni saltate:" msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" msgstr "GENERATO ALL'AVVIO AUTOMATICAMENTE -- NON MODIFICARE" +msgid "Available index files: " +msgstr "" + #, sh-format msgid "Congratulations, mission $MISSION_NB has been successfully completed!" msgstr "Congratulazioni, la missione $MISSION_NB é stata completata con successo!" diff --git a/i18n/start-full-help/en.txt b/i18n/start-full-help/en.txt new file mode 100644 index 000000000..82af36994 --- /dev/null +++ b/i18n/start-full-help/en.txt @@ -0,0 +1,50 @@ +usage: + $GSH_EXEC_FILE [OPTIONS] [INDEX_FILE1 INDEX_FILE2 ...] + +Possible values for INDEX_FILE are: $GSH_INDEX_FILES. + +If no INDEX_FILE is given, defaults to index.txt. + +Index files are ignored when continuing from a save file. + + +options: + -h simple help message + -H this message + -V display version + -I show list of available index files + + -P passport mode: ask for name / emails of player + -A anonymous mode + -d debug mode + -D verbose debug mode + + -C continue current game (if relevant) + -R reset game + -F do not check for more recent savefiles, force using the given archive + + -G do not use gettext for translation (everything will be in English) + -L ... set LANGUAGE variable (ex: -L fr:it:en) + On non GNU systems, set the variable LC_MESSAGES to a valid locale. + This flag is ignored when continuing from a save file. + + -S simple + the savefile is obtained by adding a "-save" suffix, + each savefile overwrites the previous one + -S index + savefiles are numbered so that all savefiles are kept + -S overwrite + the savefile overwrite the initial GameShell file + (you can use option -R to start a new game from the start) + + -B use bash + -Z use zsh + + -q quiet: don't show information messages + -n black and white: don't use ANSI escape codes for color + -c ... give that command to GameShell (for testing) + + -U download last version of GameShell (requires network access) + -X only extract tgz archive + -K do not remove GameShell temporary directory on exit + diff --git a/i18n/start-full-help/fr.txt b/i18n/start-full-help/fr.txt new file mode 100644 index 000000000..1c6b7bcfe --- /dev/null +++ b/i18n/start-full-help/fr.txt @@ -0,0 +1,51 @@ +utilisation : + $GSH_EXEC_FILE [OPTIONS] [INDEX_FILE1 INDEX_FILE2 ...] + +Les valeurs possibles pour INDEX_FILE sont : $GSH_INDEX_FILES. + +Si aucun INDEX_FILE n'est donné, utilise index.txt par défaut. + +Les fichier index sont ignorés lorsqu'on reprend une session à partir d'un +fichier de sauvegarde. + + +options : + -h message d'aide simplifié + -H ce message + -V affiche la version + -I affiche la liste des fichier index disponibles + + -P mode passeport : demande le nom / email du joueur + -D mode debug + -v lecture "verbeuse" des scripts de mission (seulement en mode debug) + -A mode anonyme + + -C continue la partie en cours (si pertinent) + -R recommence une partie du début + -F ne vérifie pas l'existence de fichiers de sauvegarde plus récents, + force l'utilisation de l'archive donnée + + -G désactive gettext pour les traductions (tout sera en Anglais) + -L initialise la variable LANGUAGE (ex : -L fr:it:en) + Pour les systèmes non GNU, initialisez la variable LC_MESSAGES + avec une locale valide. + Cette option est sans effet lorsqu'on reprend une session à partir + d'un fichier de sauvegarde. + + -S simple + le fichier de sauvegarde est obtenu en ajoutant un suffix "-save", + chaque fichier de sauvegarde remplace le précédent + -S index + les fichiers de sauvegarde sont numérotés pour que toutes les + sauvegardes soient conservées + -S overwrite + le fichier de sauvegarde remplace l'instance initial de GameShell + (on peut utiliser l'option -R pour lancer une partie à partir du début) + + -q mode silencieux : n'affiche pas les messages d'information + -n mode noir et blanc : n'utilise pas les séquences ANSI + -c CMD donne cette commande à GameShell (pour faire des tests) + + -U télécharge la dernière version de GameShell (nécessite un accès réseau) + -X extrait juste l'archive tgz + -K ne supprime pas le répertoire temporaire de GameShell à la sortie diff --git a/i18n/start-full-help/it.txt b/i18n/start-full-help/it.txt new file mode 100644 index 000000000..aeab87a8e --- /dev/null +++ b/i18n/start-full-help/it.txt @@ -0,0 +1,40 @@ +options: + -h messaggio di aiuto breve + -H questo avviso + -V mostra versione + -I ... + + -P modalitá passaporto: chiede il nome/email del giocatore + -A modalitá anonima + -d modalitá debug + -D modalitá debug verbosa + + -C continua la partita corrente (se rilevante) + -R reimposta la partita + -F non cercare salvataggi recenti, utilizza forzatamente l'archivio definito + + -G non utilizzare gettext per le traduzioni (sarà tutto in Inglese) + -L ... imposta la variabile LANGUAGE (ex: -L fr:it:en) + Su sistemi non GNU, imposta la variabile LC_MESSAGES + per un "locale" valido. + + -S simple + il file di salvataggio è generato con un suffiso "-save", + ogni salvataggio sovrascrive il precedente + -S index + i salvataggi sono numerati così sono tutti conservati + -S overwrite + il salvataggio sovrascrive il file iniziale di GameShell + (puoi utilizzare l'opzione -R per avviare un nuovo gioco dall'inizio) + + -B usa bash + -Z usa zsh + + -q silenzioso: non mostra avvisi informativi + -n bianco e nero: non usa i codici di escape ANSI per i colori + -c ... dai quel comando a GameShell (in testing) + + -U scarica l'ultima versione di GameShell (richiede accesso alla rete) + -X estrai solo l'archivio tgz + -K non rimuovere la cartella temporanea di GameShell all'uscita + diff --git a/i18n/start-help/en.txt b/i18n/start-help/en.txt index 2635c752d..b21510997 100644 --- a/i18n/start-help/en.txt +++ b/i18n/start-help/en.txt @@ -8,41 +8,15 @@ If no INDEX_FILE is given, defaults to index.txt. Index files are ignored when continuing from a save file. -options: +main options: -h this message + -H show all available options -V display version - -P passport mode: ask for name / emails of player - -A anonymous mode - -d debug mode - -D verbose debug mode - - -C continue current game (if relevant) -R reset game -F do not check for more recent savefiles, force using the given archive - -G do not use gettext for translation (everything will be in English) -L ... set LANGUAGE variable (ex: -L fr:it:en) On non GNU systems, set the variable LC_MESSAGES to a valid locale. This flag is ignored when continuing from a save file. - -S simple - the savefile is obtained by adding a "-save" suffix, - each savefile overwrites the previous one - -S index - savefiles are numbered so that all savefiles are kept - -S overwrite - the savefile overwrite the initial GameShell file - (you can use option -R to start a new game from the start) - - -B use bash - -Z use zsh - - -q quiet: don't show information messages - -n black and white: don't use ANSI escape codes for color - -c ... give that command to GameShell (for testing) - - -U download last version of GameShell (requires network access) - -X only extract tgz archive - -K do not remove GameShell temporary directory on exit - diff --git a/i18n/start-help/fr.txt b/i18n/start-help/fr.txt index 61d0971c0..2daa28af9 100644 --- a/i18n/start-help/fr.txt +++ b/i18n/start-help/fr.txt @@ -9,41 +9,18 @@ Les fichier index sont ignorés lorsqu'on reprend une session à partir d'un fichier de sauvegarde. -options : +options principales : -h ce message + -H affiche toutes les options -V affiche la version - -P mode passeport : demande le nom / email du joueur - -D mode debug - -v lecture "verbeuse" des scripts de mission (seulement en mode debug) - -A mode anonyme - - -C continue la partie en cours (si pertinent) -R recommence une partie du début -F ne vérifie pas l'existence de fichiers de sauvegarde plus récents, force l'utilisation de l'archive donnée - -G désactive gettext pour les traductions (tout sera en Anglais) -L initialise la variable LANGUAGE (ex : -L fr:it:en) Pour les systèmes non GNU, initialisez la variable LC_MESSAGES avec une locale valide. Cette option est sans effet lorsqu'on reprend une session à partir d'un fichier de sauvegarde. - -S simple - le fichier de sauvegarde est obtenu en ajoutant un suffix "-save", - chaque fichier de sauvegarde remplace le précédent - -S index - les fichiers de sauvegarde sont numérotés pour que toutes les - sauvegardes soient conservées - -S overwrite - le fichier de sauvegarde remplace l'instance initial de GameShell - (on peut utiliser l'option -R pour lancer une partie à partir du début) - - -q mode silencieux : n'affiche pas les messages d'information - -n mode noir et blanc : n'utilise pas les séquences ANSI - -c CMD donne cette commande à GameShell (pour faire des tests) - - -U télécharge la dernière version de GameShell (nécessite un accès réseau) - -X extrait juste l'archive tgz - -K ne supprime pas le répertoire temporaire de GameShell à la sortie diff --git a/i18n/start-help/it.txt b/i18n/start-help/it.txt index 000ea47e5..bdbc9fa59 100644 --- a/i18n/start-help/it.txt +++ b/i18n/start-help/it.txt @@ -2,37 +2,10 @@ options: -h questo avviso -V mostra versione - -P modalitá passaporto: chiede il nome/email del giocatore - -A modalitá anonima - -d modalitá debug - -D modalitá debug verbosa - - -C continua la partita corrente (se rilevante) -R reimposta la partita -F non cercare salvataggi recenti, utilizza forzatamente l'archivio definito - -G non utilizzare gettext per le traduzioni (sarà tutto in Inglese) -L ... imposta la variabile LANGUAGE (ex: -L fr:it:en) Su sistemi non GNU, imposta la variabile LC_MESSAGES per un "locale" valido. - -S simple - il file di salvataggio è generato con un suffiso "-save", - ogni salvataggio sovrascrive il precedente - -S index - i salvataggi sono numerati così sono tutti conservati - -S overwrite - il salvataggio sovrascrive il file iniziale di GameShell - (puoi utilizzare l'opzione -R per avviare un nuovo gioco dall'inizio) - - -B usa bash - -Z usa zsh - - -q silenzioso: non mostra avvisi informativi - -n bianco e nero: non usa i codici di escape ANSI per i colori - -c ... dai quel comando a GameShell (in testing) - - -U scarica l'ultima versione di GameShell (richiede accesso alla rete) - -X estrai solo l'archivio tgz - -K non rimuovere la cartella temporanea di GameShell all'uscita - diff --git a/i18n/template.pot b/i18n/template.pot index 81f5f76a6..6dcbeb194 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -18,6 +18,10 @@ msgstr "" msgid "$GSH_ROOT/i18n/gameshell-welcome/en.txt" msgstr "" +#, sh-format +msgid "$GSH_ROOT/i18n/start-full-help/en.txt" +msgstr "" + #, sh-format msgid "$GSH_ROOT/i18n/start-help/en.txt" msgstr "" @@ -75,6 +79,9 @@ msgstr[1] "" msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" msgstr "" +msgid "Available index files: " +msgstr "" + #, sh-format msgid "Congratulations, mission $MISSION_NB has been successfully completed!" msgstr "" diff --git a/lib/header.sh b/lib/header.sh index 18384155b..4a1830b38 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -34,7 +34,7 @@ GSH_EXEC_DIR=$(cd "$GSH_EXEC_DIR"; pwd -P) # just in case GSH_EXEC_DIR=${GSH_EXEC_DIR:-.} -while getopts ":hnPdDACRXUVqGL:KBZc:FS:" opt +while getopts ":hHInPdDACRXUVqGL:KBZc:FS:" opt do case "$opt" in V) @@ -85,7 +85,7 @@ do F) GSH_FORCE="true" ;; - h) + h | H | I) # used to avoid checking for more recent files GSH_HELP="true" ;; diff --git a/start.sh b/start.sh index b753feb80..8ae49d2b2 100755 --- a/start.sh +++ b/start.sh @@ -24,6 +24,12 @@ export GSH_ROOT="$(dirname "$0")" # shellcheck source=lib/mission_source.sh . "$GSH_ROOT/lib/mission_source.sh" +display_full_help() { + sed -e "s/\$GSH_EXEC_FILE/$GSH_EXEC_FILE/" \ + -e "s/\$GSH_INDEX_FILES/$(echo "$GSH_INDEX_FILES" | sed "s/:/, /g")/" \ + "$(eval_gettext "\$GSH_ROOT/i18n/start-full-help/en.txt")" +} + display_help() { sed -e "s/\$GSH_EXEC_FILE/$GSH_EXEC_FILE/" \ -e "s/\$GSH_INDEX_FILES/$(echo "$GSH_INDEX_FILES" | sed "s/:/, /g")/" \ @@ -32,7 +38,7 @@ display_help() { # list of index files (default: only index.txt) -export GSH_INDEX_FILES=index.txt +export GSH_INDEX_FILES=index.txt # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh # possible values: index, simple (default), overwrite export GSH_SAVEFILE_MODE="simple" @@ -42,7 +48,7 @@ GSH_MODE="ANONYMOUS" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" -while getopts ":hnPdDACRXUVqGL:KBZc:FS:" opt +while getopts ":hHInPdDACRXUVqGL:KBZc:FS:" opt do case $opt in S) @@ -60,6 +66,15 @@ do display_help exit 0 ;; + H) + display_full_help + exit 0 + ;; + I) + gettext "Available index files: " >&2 + echo "$GSH_INDEX_FILES" | sed "s/:/, /g" >&2 + exit 0 + ;; n) GSH_COLOR="" ;; From 8b6b66aecf074bb1457671e5c1c0817ccf432158 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 15:06:25 +0100 Subject: [PATCH 058/103] missing redirection to stderr for some messages --- missions/intermediate/06_control-C/Charmiglio.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/missions/intermediate/06_control-C/Charmiglio.sh b/missions/intermediate/06_control-C/Charmiglio.sh index 28755184f..81c2275cd 100755 --- a/missions/intermediate/06_control-C/Charmiglio.sh +++ b/missions/intermediate/06_control-C/Charmiglio.sh @@ -51,14 +51,14 @@ magical_reaction() { printf "%*s%s" "$indent" '' "$(random_string "$width" "$alpha")" >&2 if [ "$delay" -gt 2 ] && [ "$((delay % 10))" -eq 0 ] && [ "$show_msg" != 0 ] then - printf "\t\t$(gettext "You can stop the incantation with Control-c.")" + printf "\t\t$(gettext "You can stop the incantation with Control-c.")" >&2 show_msg=0 fi if [ "$((delay % 10))" -eq 1 ] then show_msg=1 fi - echo + echo >&2 sleep 0.1 done } From 6a71b2b77ccc29432b82532acdc82b16a1bd5b14 Mon Sep 17 00:00:00 2001 From: Olivier Mattelaer Date: Mon, 18 Nov 2024 13:39:48 +0100 Subject: [PATCH 059/103] fix semaphore --- missions/processes/02_ps_kill_signal/clean.sh | 3 ++- missions/processes/02_ps_kill_signal/spell.c | 15 +++++++++++++-- missions/processes/03_pstree_kill/clean.sh | 1 + missions/processes/03_pstree_kill/spell.c | 9 ++++++++- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/missions/processes/02_ps_kill_signal/clean.sh b/missions/processes/02_ps_kill_signal/clean.sh index f3b9d8bdd..06a0265e3 100644 --- a/missions/processes/02_ps_kill_signal/clean.sh +++ b/missions/processes/02_ps_kill_signal/clean.sh @@ -4,5 +4,6 @@ kill -9 $(cat "$GSH_TMP/spell-term.pids" 2>/dev/null) 2>/dev/null kill -9 $(cat "$GSH_TMP/spell.pids" 2>/dev/null) 2>/dev/null my_ps | awk '/sleep|tail/ {print $1}' | xargs kill -9 2>/dev/null rm -f "$GSH_TMP/spell-term.pids" "$GSH_TMP/spell.pids" "$GSH_TMP/$(gettext "spell")" - +rm --system -f /dev/shm/sem.writing_sem_${USER} +rm --system -f /dev/shm/sem.printing_sem_${USER} [ -n "$GSH_NON_INTERACTIVE" ] || set -o monitor # monitor background processes (default) diff --git a/missions/processes/02_ps_kill_signal/spell.c b/missions/processes/02_ps_kill_signal/spell.c index 61061655f..9cdfe908a 100644 --- a/missions/processes/02_ps_kill_signal/spell.c +++ b/missions/processes/02_ps_kill_signal/spell.c @@ -119,11 +119,22 @@ int main() } // Initialize semaphores. - printing_sem = sem_open("/printing_sem", O_CREAT, 0644, 1); + // + char login[20]; + getlogin_r(login, 20); + char sem_path[30]; + strcpy(sem_path, "/printing_sem_"); + strcat(sem_path,login); + + printing_sem = sem_open(sem_path, O_CREAT, 0644, 1); if (printing_sem == SEM_FAILED) return 1; - writing_sem = sem_open("/writing_sem", O_CREAT, 0644, 1); + + strcpy(sem_path, "/writing_sem_"); + strcat(sem_path,login); + + writing_sem = sem_open(sem_path, O_CREAT, 0644, 1); if (writing_sem == SEM_FAILED) return 1; diff --git a/missions/processes/03_pstree_kill/clean.sh b/missions/processes/03_pstree_kill/clean.sh index 3de250d49..6ec5e4df5 100644 --- a/missions/processes/03_pstree_kill/clean.sh +++ b/missions/processes/03_pstree_kill/clean.sh @@ -15,6 +15,7 @@ rm -f "$GSH_TMP/fairy.pid" rm -f "$GSH_TMP/imp.pid" rm -f "$GSH_TMP/$(gettext "nice_fairy")" rm -f "$GSH_TMP/$(gettext "mischievous_imp")" +rm --system -f /dev/shm/sem.writing_sem_${USER} ( cd "$(eval_gettext '$GSH_HOME/Castle/Cellar')" # keep at most 10 snowflakes diff --git a/missions/processes/03_pstree_kill/spell.c b/missions/processes/03_pstree_kill/spell.c index 7f4f4274f..137410964 100644 --- a/missions/processes/03_pstree_kill/spell.c +++ b/missions/processes/03_pstree_kill/spell.c @@ -124,7 +124,14 @@ int main() /* printf(">>> log_file = '%s'\n", log_file); */ wordfree(&result); - writing_sem = sem_open("/writing_sem", O_CREAT, 0644, 1); + char login[20]; + getlogin_r(login, 20); + char sem_path[30]; + strcpy(sem_path, "/writing_sem_"); + strcat(sem_path,login); + + + writing_sem = sem_open(sem_path, O_CREAT, 0644, 1); if (writing_sem == SEM_FAILED) return 1; From 08023626d05e014246771be796551ccea8a93183 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 16:12:28 +0100 Subject: [PATCH 060/103] small clean for semaphore PR --- missions/processes/02_ps_kill_signal/clean.sh | 4 ++-- missions/processes/02_ps_kill_signal/spell.c | 17 +++++++++-------- missions/processes/03_pstree_kill/clean.sh | 2 +- missions/processes/03_pstree_kill/spell.c | 11 ++++++----- 4 files changed, 18 insertions(+), 16 deletions(-) diff --git a/missions/processes/02_ps_kill_signal/clean.sh b/missions/processes/02_ps_kill_signal/clean.sh index 06a0265e3..d3f74cb5a 100644 --- a/missions/processes/02_ps_kill_signal/clean.sh +++ b/missions/processes/02_ps_kill_signal/clean.sh @@ -4,6 +4,6 @@ kill -9 $(cat "$GSH_TMP/spell-term.pids" 2>/dev/null) 2>/dev/null kill -9 $(cat "$GSH_TMP/spell.pids" 2>/dev/null) 2>/dev/null my_ps | awk '/sleep|tail/ {print $1}' | xargs kill -9 2>/dev/null rm -f "$GSH_TMP/spell-term.pids" "$GSH_TMP/spell.pids" "$GSH_TMP/$(gettext "spell")" -rm --system -f /dev/shm/sem.writing_sem_${USER} -rm --system -f /dev/shm/sem.printing_sem_${USER} +rm --system -f /dev/shm/"sem.writing_sem_${USER}" +rm --system -f /dev/shm/"sem.printing_sem_${USER}" [ -n "$GSH_NON_INTERACTIVE" ] || set -o monitor # monitor background processes (default) diff --git a/missions/processes/02_ps_kill_signal/spell.c b/missions/processes/02_ps_kill_signal/spell.c index 9cdfe908a..42f3334b2 100644 --- a/missions/processes/02_ps_kill_signal/spell.c +++ b/missions/processes/02_ps_kill_signal/spell.c @@ -120,19 +120,20 @@ int main() // Initialize semaphores. // - char login[20]; - getlogin_r(login, 20); - char sem_path[30]; - strcpy(sem_path, "/printing_sem_"); - strcat(sem_path,login); + char login[128]; + getlogin_r(login, 128); + char sem_path[256]; + strncpy(sem_path, "/printing_sem_", 128); + strncat(sem_path, login, 128); + sem_path[255] = '\0'; printing_sem = sem_open(sem_path, O_CREAT, 0644, 1); if (printing_sem == SEM_FAILED) return 1; - - strcpy(sem_path, "/writing_sem_"); - strcat(sem_path,login); + strncpy(sem_path, "/writing_sem_", 128); + strncat(sem_path, login, 128); + sem_path[255] = '\0'; writing_sem = sem_open(sem_path, O_CREAT, 0644, 1); if (writing_sem == SEM_FAILED) diff --git a/missions/processes/03_pstree_kill/clean.sh b/missions/processes/03_pstree_kill/clean.sh index 6ec5e4df5..449c23b97 100644 --- a/missions/processes/03_pstree_kill/clean.sh +++ b/missions/processes/03_pstree_kill/clean.sh @@ -15,7 +15,7 @@ rm -f "$GSH_TMP/fairy.pid" rm -f "$GSH_TMP/imp.pid" rm -f "$GSH_TMP/$(gettext "nice_fairy")" rm -f "$GSH_TMP/$(gettext "mischievous_imp")" -rm --system -f /dev/shm/sem.writing_sem_${USER} +rm --system -f /dev/shm/"sem.writing_sem_${USER}" ( cd "$(eval_gettext '$GSH_HOME/Castle/Cellar')" # keep at most 10 snowflakes diff --git a/missions/processes/03_pstree_kill/spell.c b/missions/processes/03_pstree_kill/spell.c index 137410964..184a58d09 100644 --- a/missions/processes/03_pstree_kill/spell.c +++ b/missions/processes/03_pstree_kill/spell.c @@ -124,11 +124,12 @@ int main() /* printf(">>> log_file = '%s'\n", log_file); */ wordfree(&result); - char login[20]; - getlogin_r(login, 20); - char sem_path[30]; - strcpy(sem_path, "/writing_sem_"); - strcat(sem_path,login); + char login[128]; + getlogin_r(login, 128); + char sem_path[256]; + strncpy(sem_path, "/writing_sem_", 128); + strncat(sem_path, login, 128); + sem_path[255] = '\0'; writing_sem = sem_open(sem_path, O_CREAT, 0644, 1); From 111cf1a4d70d49f15c9f0ed4d7990f22ea28b37f Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 17:39:45 +0100 Subject: [PATCH 061/103] make it possible to choose several index files I also change the way make_index works: - if used from a self extracting archive, prefix all arguments with $GSH_MISSIONS/ - otherwise, use the actual files given from the command line I also print a warning when giving index files in "continue" mode, as those are not used. --- i18n/en.po | 8 ++++++++ i18n/fr.po | 8 ++++++++ i18n/it.po | 8 ++++++++ i18n/template.pot | 8 ++++++++ scripts/make_index | 12 +++++------- start.sh | 41 +++++++++++++++++++++++++++++++++++------ 6 files changed, 72 insertions(+), 13 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index 397549b7b..52783e498 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -207,6 +207,14 @@ msgstr "There are stopped jobs in your session.\n" " $ jobs\n" "Do you still want to quit? [y/n]" +#, sh-format +msgid "Warning: command line arguments are ignored when continuing a game ($args)" +msgstr "Warning: command line arguments are ignored when continuing a game ($args)" + +#, sh-format +msgid "Warning: language is ignored when continuing a game ($args)" +msgstr "Warning: language is ignored when continuing a game ($args)" + msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" "You should use the command\n" " $ gsh reset" diff --git a/i18n/fr.po b/i18n/fr.po index 3dc605b73..b9c1c9c59 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -212,6 +212,14 @@ msgstr "Il y a des processus stoppés dans votre session.\n" " $ jobs\n" "Êtes vous sûr de vouloir quitter ? [o/N]" +#, sh-format +msgid "Warning: command line arguments are ignored when continuing a game ($args)" +msgstr "Warning: les arguments sur la ligne de commande sont ignorés lorsqu'on reprend une partie ($args)" + +#, sh-format +msgid "Warning: language is ignored when continuing a game ($args)" +msgstr "Warning: la langue est ignorée lorsqu'on reprend une partie ($args)" + msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" "You should use the command\n" " $ gsh reset" diff --git a/i18n/it.po b/i18n/it.po index 4269b1b71..75cfa594d 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -222,6 +222,14 @@ msgstr "Ci sono dei processi fermati nella tua sessione.\n" "Vuoi uscire lo stesso? [s/n\n" "]" +#, sh-format +msgid "Warning: command line arguments are ignored when continuing a game ($args)" +msgstr "" + +#, sh-format +msgid "Warning: language is ignored when continuing a game ($args)" +msgstr "" + msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" "You should use the command\n" " $ gsh reset" diff --git a/i18n/template.pot b/i18n/template.pot index 6dcbeb194..3f11566ee 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -197,6 +197,14 @@ msgid "There are stopped jobs in your session.\n" "Do you still want to quit? [y/n]" msgstr "" +#, sh-format +msgid "Warning: command line arguments are ignored when continuing a game ($args)" +msgstr "" + +#, sh-format +msgid "Warning: language is ignored when continuing a game ($args)" +msgstr "" + msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" "You should use the command\n" " $ gsh reset" diff --git a/scripts/make_index b/scripts/make_index index ce8dbfe5a..6f3ab7bd8 100755 --- a/scripts/make_index +++ b/scripts/make_index @@ -115,19 +115,17 @@ make_index() { return 0 fi - if [ "$#" -eq 1 ] && [ -f "$GSH_MISSIONS/$1" ] + # when used from a self extracting archive, all path are prefixed with the + # mission directory + if [ -n "$GSH_EXEC_FILE" ] then - # with a single file argument, we assume it is an index file - parse_index "$GSH_MISSIONS/$1" || exit 1 - return 0 + PREFIX="$GSH_MISSIONS/" fi # otherwise, parse each mission / index file from the arguments - # (Note, it should not be used from a GameShell instance, but only directly - # from ``start.sh`` or from ``utils/archive.sh`` while [ "$#" -gt 0 ] do - MISSION_DIR=$(readlink-f "$1") + MISSION_DIR=$(readlink-f "$PREFIX$1") if [ -e "$MISSION_DIR" ] then parse_mission "$MISSION_DIR" || exit 1 diff --git a/start.sh b/start.sh index 8ae49d2b2..a8d577d55 100755 --- a/start.sh +++ b/start.sh @@ -38,7 +38,7 @@ display_help() { # list of index files (default: only index.txt) -export GSH_INDEX_FILES=index.txt # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh +export GSH_INDEX_FILES=index.txt # possible values: index, simple (default), overwrite export GSH_SAVEFILE_MODE="simple" @@ -102,6 +102,13 @@ do ;; L) export LANGUAGE="$OPTARG" # only works on GNU systems + if [ "$RESET" = FALSE ] + then + args="-L $OPTARG" + echo "$(eval_gettext 'Warning: language is ignored when continuing a game ($args)')" >&2 + echo "$(gettext 'Press Enter to continue.')" >&2 + read -r _ + fi ;; G) export GSH_NO_GETTEXT=1 @@ -249,18 +256,40 @@ init_gsh() { # - continue the previous game if [ -e "$GSH_CONFIG" ] then - if [ -z "$RESET" ] - then + + while [ -z "$RESET" ] + do local r printf "$(eval_gettext 'The directory $GSH_CONFIG contains meta-data from a previous game. Do you want to remove it and start a new game? [y/N]') " read -r r - [ "$r" = "$(gettext "y")" ] || [ "$r" = "$(gettext "Y")" ] || return 1 + if [ "$r" = "$(gettext "y")" ] || [ "$r" = "$(gettext "Y")" ] + then + RESET=TRUE + echo + fi + if [ -z "$r" ] || [ "$r" = "$(gettext "n")" ] || [ "$r" = "$(gettext "N")" ] + then + RESET=FALSE + echo + fi + done - elif [ "$RESET" = "FALSE" ] + else + # if no data is found, we need to initialize a new game + RESET=TRUE + fi + + if [ "$RESET" = FALSE ] + then + if [ "$#" -gt 0 ] then - return 1 + args=$* + echo "$(eval_gettext 'Warning: command line arguments are ignored when continuing a game ($args)')" >&2 + echo "$(gettext 'Press Enter to continue.')" >&2 + read -r _ fi + return 1 fi ### if we're here, we need to reset a new game From c86687141a84d3bd230e333130b7d82e15aa96f6 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 17:55:15 +0100 Subject: [PATCH 062/103] unnecessary 'set -m' in test / auto files I also had to fix some bugs so the test / auto files worked with non-interactive shells. --- missions/intermediate/05_background/auto.sh | 2 +- missions/intermediate/05_background/charmiglio.sh | 4 ++-- missions/intermediate/05_background/test.sh | 4 ++-- missions/intermediate/06_control-C/auto.sh | 7 ++++--- missions/intermediate/06_control-C/test.sh | 7 ++++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/missions/intermediate/05_background/auto.sh b/missions/intermediate/05_background/auto.sh index f9bb5b0cb..f6a5358a8 100644 --- a/missions/intermediate/05_background/auto.sh +++ b/missions/intermediate/05_background/auto.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -set -m +# set -m charmiglio & charmiglio & charmiglio & gsh check diff --git a/missions/intermediate/05_background/charmiglio.sh b/missions/intermediate/05_background/charmiglio.sh index a11a8b1a5..e7b34bacd 100755 --- a/missions/intermediate/05_background/charmiglio.sh +++ b/missions/intermediate/05_background/charmiglio.sh @@ -6,10 +6,10 @@ command=$(gettext "charmiglio") file="$MISSION_DIR/ascii-art/f$((1 + $(RANDOM)%6))" -indent=$(echo " " | head -c "$((4 * ($(RANDOM)%8)))") +indent=$(echo " " | head -c "$((2 + 4 * ($(RANDOM)%8)))") rm -f "$GSH_TMP/charmiglio.pids" -for i in $(seq $((5 + $(RANDOM)%10))) +for i in $(seq $((5 + $(RANDOM)%5))) do echo "$indent *" sleep 0.1 diff --git a/missions/intermediate/05_background/test.sh b/missions/intermediate/05_background/test.sh index 521355040..3c8de8362 100644 --- a/missions/intermediate/05_background/test.sh +++ b/missions/intermediate/05_background/test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -m +# set -m gsh assert check false charmiglio & gsh assert check false @@ -11,7 +11,7 @@ charmiglio & charmiglio & charmiglio & charmiglio & gsh assert check true charmiglio & charmiglio & charmiglio gsh assert check false -charmiglio; charmiglio; charmiglio; +charmiglio; charmiglio; charmiglio gsh assert check false diff --git a/missions/intermediate/06_control-C/auto.sh b/missions/intermediate/06_control-C/auto.sh index 63e4eb2c7..6293bb965 100644 --- a/missions/intermediate/06_control-C/auto.sh +++ b/missions/intermediate/06_control-C/auto.sh @@ -1,13 +1,14 @@ #!/usr/bin/env sh -set -m +# set -m for c in a b c d e f do - eval "$(gettext Charmiglio)" "$c$c$c$c" 2>/dev/null & + eval "$(gettext Charmiglio) $c$c$c$c &" 2>/dev/null PID=$! sleep 4 - kill -s INT "-$PID" 2> /dev/null + # NOTE: SIGINT signal doesn't work on non-interactive systems + kill "$PID" 2> /dev/null case "$(cat "$GSH_TMP/control-C")" in *[!0-9]*) diff --git a/missions/intermediate/06_control-C/test.sh b/missions/intermediate/06_control-C/test.sh index 7f6d11c1c..c4d566a2d 100644 --- a/missions/intermediate/06_control-C/test.sh +++ b/missions/intermediate/06_control-C/test.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -set -m +# set -m do_test() { nb=$1 @@ -8,10 +8,11 @@ do_test() { for c in $(echo "a b c d e f g h i j" | cut -d' ' -f1-$nb) do - eval "$(gettext Charmiglio)" "$c$c$c$c" 2>/dev/null & + eval "$(gettext Charmiglio) $c$c$c$c &" 2>/dev/null PID=$! sleep "$delay" - kill -s INT "-$PID" 2> /dev/null + # NOTE: SIGINT signal doesn't work on non-interactive systems + kill "$PID" 2> /dev/null case "$(cat "$GSH_TMP/control-C")" in *[!0-9]*) From c9e4881f69bd01f51ff97149576013dbd19ef15b Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 20:25:50 +0100 Subject: [PATCH 063/103] renamed index.txt files to default.idx it is probably clearer that the default index file is called "default.idx" instead of index.txt --- doc/mission.md | 12 ++++++------ i18n/start-full-help/en.txt | 2 +- i18n/start-full-help/fr.txt | 2 +- i18n/start-help/en.txt | 2 +- i18n/start-help/fr.txt | 2 +- lib/gsh.sh | 2 +- missions/basic/{index.txt => default.idx} | 0 missions/{index.txt => default.idx} | 12 ++++++------ .../finding_files_maze/{index.txt => default.idx} | 0 missions/intermediate/{index.txt => default.idx} | 0 missions/misc/{index.txt => default.idx} | 0 missions/permissions/{index.txt => default.idx} | 0 .../{index.txt => default.idx} | 0 .../pipes_merchant_stall/{index.txt => default.idx} | 0 missions/processes/{index.txt => default.idx} | 0 .../stdin_stdout_stderr/{index.txt => default.idx} | 0 scripts/_gsh_index | 2 +- scripts/make_index | 8 ++++---- scripts/missiondir | 2 +- start.sh | 10 +++++----- utils/archive.sh | 10 +++++----- 21 files changed, 33 insertions(+), 33 deletions(-) rename missions/basic/{index.txt => default.idx} (100%) rename missions/{index.txt => default.idx} (73%) rename missions/finding_files_maze/{index.txt => default.idx} (100%) rename missions/intermediate/{index.txt => default.idx} (100%) rename missions/misc/{index.txt => default.idx} (100%) rename missions/permissions/{index.txt => default.idx} (100%) rename missions/pipe_intro_book_of_potions/{index.txt => default.idx} (100%) rename missions/pipes_merchant_stall/{index.txt => default.idx} (100%) rename missions/processes/{index.txt => default.idx} (100%) rename missions/stdin_stdout_stderr/{index.txt => default.idx} (100%) diff --git a/doc/mission.md b/doc/mission.md index 00aaefd24..9f6ec8abe 100644 --- a/doc/mission.md +++ b/doc/mission.md @@ -442,13 +442,13 @@ which make testing easier. Those files are not included in GameShell archives. -Adding the mission to the `index.txt` file ----------------------------------------- +Adding the mission to the `default.idx` file +------------------------------------------ When run without arguments GameShell will get the list of mission from the -file `$GSH_ROOT/missions/index.txt`. +file `$GSH_ROOT/missions/default.idx`. -You can give a list of `index.txt` files and mission directories as arguments +You can give a list of `default.idx` files and mission directories as arguments of GameShell if you want to customize the list / order of missions. This is particularly useful when testing a new mission: ```sh @@ -464,7 +464,7 @@ Dummy missions "Dummy" missions are used to share data between missions. A mission is "dummy" * either when it doesn't contain a `check.sh` script, -* or it is listed with a "`!`" in front of its name in the `index.txt` file. +* or it is listed with a "`!`" in front of its name in the `default.idx` file. A dummy mission is used during the initialisation phase, so that it can contain a `static.sh` file. It can for example be used to share executable @@ -483,7 +483,7 @@ cp "$MISSION_DIR/../00_shared/ascii-art/elephant.txt" "$GSH_HOME/Jungle/" ``` _Note:_ don't forget to include dummy missions in the corresponding -`index.txt` file, or it won't be included in GameShell executable archives by +`default.idx` file, or it won't be included in GameShell executable archives by default. diff --git a/i18n/start-full-help/en.txt b/i18n/start-full-help/en.txt index 82af36994..5f5a63ed1 100644 --- a/i18n/start-full-help/en.txt +++ b/i18n/start-full-help/en.txt @@ -3,7 +3,7 @@ usage: Possible values for INDEX_FILE are: $GSH_INDEX_FILES. -If no INDEX_FILE is given, defaults to index.txt. +If no INDEX_FILE is given, defaults to default.idx. Index files are ignored when continuing from a save file. diff --git a/i18n/start-full-help/fr.txt b/i18n/start-full-help/fr.txt index 1c6b7bcfe..d48a5730f 100644 --- a/i18n/start-full-help/fr.txt +++ b/i18n/start-full-help/fr.txt @@ -3,7 +3,7 @@ utilisation : Les valeurs possibles pour INDEX_FILE sont : $GSH_INDEX_FILES. -Si aucun INDEX_FILE n'est donné, utilise index.txt par défaut. +Si aucun INDEX_FILE n'est donné, utilise default.idx par défaut. Les fichier index sont ignorés lorsqu'on reprend une session à partir d'un fichier de sauvegarde. diff --git a/i18n/start-help/en.txt b/i18n/start-help/en.txt index b21510997..7d57373a6 100644 --- a/i18n/start-help/en.txt +++ b/i18n/start-help/en.txt @@ -3,7 +3,7 @@ usage: Possible values for INDEX_FILE are: $GSH_INDEX_FILES. -If no INDEX_FILE is given, defaults to index.txt. +If no INDEX_FILE is given, defaults to default.idx. Index files are ignored when continuing from a save file. diff --git a/i18n/start-help/fr.txt b/i18n/start-help/fr.txt index 2daa28af9..d87067172 100644 --- a/i18n/start-help/fr.txt +++ b/i18n/start-help/fr.txt @@ -3,7 +3,7 @@ utilisation : Les valeurs possibles pour INDEX_FILE sont : $GSH_INDEX_FILES. -Si aucun INDEX_FILE n'est donné, utilise index.txt par défaut. +Si aucun INDEX_FILE n'est donné, utilise default.idx par défaut. Les fichier index sont ignorés lorsqu'on reprend une session à partir d'un fichier de sauvegarde. diff --git a/lib/gsh.sh b/lib/gsh.sh index e3b8f4ecd..26e803c76 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -119,7 +119,7 @@ _gsh_resetstatic() { printf "." >&2 fi - done < "$GSH_CONFIG/current_index.txt" + done < "$GSH_CONFIG/index.idx" echo "" >&2 unset MISSION_DIR DOMAIN diff --git a/missions/basic/index.txt b/missions/basic/default.idx similarity index 100% rename from missions/basic/index.txt rename to missions/basic/default.idx diff --git a/missions/index.txt b/missions/default.idx similarity index 73% rename from missions/index.txt rename to missions/default.idx index 428ceb7fc..5fe59affd 100644 --- a/missions/index.txt +++ b/missions/default.idx @@ -1,6 +1,6 @@ # default Gameshell missions order - basic/index.txt + basic/default.idx misc/01_cal_nostradamus intermediate/01_alias_la misc/02_nano_journal @@ -13,12 +13,12 @@ finding_files_maze/01_ls_cd finding_files_maze/02_tree finding_files_maze/03_find_1 - pipe_intro_book_of_potions/index.txt - processes/index.txt - stdin_stdout_stderr/index.txt - permissions/index.txt + pipe_intro_book_of_potions/default.idx + processes/default.idx + stdin_stdout_stderr/default.idx + permissions/default.idx finding_files_maze/04_find_2 finding_files_maze/05_find_xargs_grep - pipes_merchant_stall/index.txt + pipes_merchant_stall/default.idx misc/03_tr_caesar_shift FINAL_MISSION diff --git a/missions/finding_files_maze/index.txt b/missions/finding_files_maze/default.idx similarity index 100% rename from missions/finding_files_maze/index.txt rename to missions/finding_files_maze/default.idx diff --git a/missions/intermediate/index.txt b/missions/intermediate/default.idx similarity index 100% rename from missions/intermediate/index.txt rename to missions/intermediate/default.idx diff --git a/missions/misc/index.txt b/missions/misc/default.idx similarity index 100% rename from missions/misc/index.txt rename to missions/misc/default.idx diff --git a/missions/permissions/index.txt b/missions/permissions/default.idx similarity index 100% rename from missions/permissions/index.txt rename to missions/permissions/default.idx diff --git a/missions/pipe_intro_book_of_potions/index.txt b/missions/pipe_intro_book_of_potions/default.idx similarity index 100% rename from missions/pipe_intro_book_of_potions/index.txt rename to missions/pipe_intro_book_of_potions/default.idx diff --git a/missions/pipes_merchant_stall/index.txt b/missions/pipes_merchant_stall/default.idx similarity index 100% rename from missions/pipes_merchant_stall/index.txt rename to missions/pipes_merchant_stall/default.idx diff --git a/missions/processes/index.txt b/missions/processes/default.idx similarity index 100% rename from missions/processes/index.txt rename to missions/processes/default.idx diff --git a/missions/stdin_stdout_stderr/index.txt b/missions/stdin_stdout_stderr/default.idx similarity index 100% rename from missions/stdin_stdout_stderr/index.txt rename to missions/stdin_stdout_stderr/default.idx diff --git a/scripts/_gsh_index b/scripts/_gsh_index index cd578bc57..b014c3159 100755 --- a/scripts/_gsh_index +++ b/scripts/_gsh_index @@ -48,4 +48,4 @@ do color_echo "$COLOR" "$mission_dir$SKIPPABLE$STATUS" n="$((n + 1))" -done < "$GSH_CONFIG/current_index.txt" | pager +done < "$GSH_CONFIG/index.idx" | pager diff --git a/scripts/make_index b/scripts/make_index index 6f3ab7bd8..29fe963c1 100755 --- a/scripts/make_index +++ b/scripts/make_index @@ -28,10 +28,10 @@ parse_mission() ( parse_index "$MISSION_DIR" || exit 1 elif [ -d "$MISSION_DIR" ] then - # if a directory contains index.txt, call parse_index recursively - if [ -f "$MISSION_DIR/index.txt" ] + # if a directory contains default.idx, call parse_index recursively + if [ -f "$MISSION_DIR/default.idx" ] then - parse_index "$MISSION_DIR/index.txt" || exit 1 + parse_index "$MISSION_DIR/default.idx" || exit 1 # if a directory contains a check.sh script, it is a standard mission elif [ -f "$MISSION_DIR/check.sh" ] || [ -n "$DUMMY" ] @@ -111,7 +111,7 @@ make_index() { if [ "$#" -eq 0 ] then # without argument, use the default index file - parse_index "$GSH_MISSIONS/index.txt" || exit 1 + parse_index "$GSH_MISSIONS/default.idx" || exit 1 return 0 fi diff --git a/scripts/missiondir b/scripts/missiondir index 8142f3aa9..fed5ef188 100755 --- a/scripts/missiondir +++ b/scripts/missiondir @@ -12,7 +12,7 @@ fi # get the mission directory n=$1 -dir=$(awk -v n="$n" -v DIR="$GSH_MISSIONS" '/^\s*[#!]/{next} /^$/{next} {N++} (N == n){print DIR "/" $0; exit}' "$GSH_CONFIG/current_index.txt") +dir=$(awk -v n="$n" -v DIR="$GSH_MISSIONS" '/^\s*[#!]/{next} /^$/{next} {N++} (N == n){print DIR "/" $0; exit}' "$GSH_CONFIG/index.idx") if [ -z "$dir" ] then echo "Error: missiondir, mission '$n' not found." >&2 diff --git a/start.sh b/start.sh index a8d577d55..60694e42a 100755 --- a/start.sh +++ b/start.sh @@ -37,8 +37,8 @@ display_help() { } -# list of index files (default: only index.txt) -export GSH_INDEX_FILES=index.txt +# list of index files (default: only default.idx) +export GSH_INDEX_FILES=default.idx # possible values: index, simple (default), overwrite export GSH_SAVEFILE_MODE="simple" @@ -225,7 +225,7 @@ progress() { if [ -z "$progress_I" ] then progress_filename=$GSH_ROOT/lib/ascii-art/titlescreen - local N=$(wc -l "$GSH_CONFIG/current_index.txt" | awk '{print $1}') + local N=$(wc -l "$GSH_CONFIG/index.idx" | awk '{print $1}') local size=$(wc -c "$progress_filename" | awk '{print $1}') progress_delta=$((size/N + 1)) # head -c$((progress_delta - 1)) $progress_filename => not POSIX compliant @@ -388,7 +388,7 @@ Do you want to remove it and start a new game? [y/N]') " clear fi - make_index "$@" | sed -e "s;$GSH_MISSIONS;.;" > "$GSH_CONFIG/current_index.txt" + make_index "$@" | sed -e "s;$GSH_MISSIONS;.;" > "$GSH_CONFIG/index.idx" if [ "$GSH_MODE" != "DEBUG" ] then @@ -498,7 +498,7 @@ Do you want to remove it and start a new game? [y/N]') " [ -z "$MISSION_SUB_NB" ] && MISSION_NB=$((MISSION_NB+1)) - done < "$GSH_CONFIG/current_index.txt" + done < "$GSH_CONFIG/index.idx" if [ "$MISSION_NB" -eq 1 ] then echo "$(gettext "Error: no mission was found! diff --git a/utils/archive.sh b/utils/archive.sh index a2272fa58..885865f01 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -92,7 +92,7 @@ do esac ;; I) - if [ "$OPTARG" = "index.txt" ] || [ "$OPTARG" = "current_index.txt" ] + if [ "$OPTARG" = "default.idx" ] then echo "Warning: ignoring additional index file with name '$OPTARG'" else @@ -161,11 +161,11 @@ cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/li # generate default index file -ALL_INDEX_FILES=index.txt +ALL_INDEX_FILES=default.idx mkdir "$TMP_DIR/$NAME/missions" -if ! make_index "$@" > "$TMP_DIR/$NAME/missions/index.txt" +if ! make_index "$@" > "$TMP_DIR/$NAME/missions/default.idx" then - echo "Error: archive.sh, couldn't make index.txt" + echo "Error: archive.sh, couldn't make default.idx" # --system makes GameShell use the standard rm utility instead of the "safe" # rm implemented in scripts/rm rm --system -rf "$TMP_DIR" @@ -338,7 +338,7 @@ then printf "." fi fi - done < "$GSH_ROOT/missions/index.txt" + done < "$GSH_ROOT/missions/default.idx" echo } fi From 285d8b1a9d5078ef1da4ebf7e509b4db668479cd Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 18 Nov 2024 20:30:04 +0100 Subject: [PATCH 064/103] added -I option to short help message --- i18n/start-help/en.txt | 1 + i18n/start-help/fr.txt | 1 + 2 files changed, 2 insertions(+) diff --git a/i18n/start-help/en.txt b/i18n/start-help/en.txt index 7d57373a6..0c2d46ae2 100644 --- a/i18n/start-help/en.txt +++ b/i18n/start-help/en.txt @@ -12,6 +12,7 @@ main options: -h this message -H show all available options -V display version + -I show list of available index files -R reset game -F do not check for more recent savefiles, force using the given archive diff --git a/i18n/start-help/fr.txt b/i18n/start-help/fr.txt index d87067172..39650c7e8 100644 --- a/i18n/start-help/fr.txt +++ b/i18n/start-help/fr.txt @@ -13,6 +13,7 @@ options principales : -h ce message -H affiche toutes les options -V affiche la version + -I affiche la liste des fichier index disponibles -R recommence une partie du début -F ne vérifie pas l'existence de fichiers de sauvegarde plus récents, From d345dbe04a27ce3f9f0339e26034920a04bc9ced Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 12:21:22 +0100 Subject: [PATCH 065/103] remove warning in case language is changed because it doesn't work --- start.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/start.sh b/start.sh index 60694e42a..880e882e2 100755 --- a/start.sh +++ b/start.sh @@ -102,13 +102,6 @@ do ;; L) export LANGUAGE="$OPTARG" # only works on GNU systems - if [ "$RESET" = FALSE ] - then - args="-L $OPTARG" - echo "$(eval_gettext 'Warning: language is ignored when continuing a game ($args)')" >&2 - echo "$(gettext 'Press Enter to continue.')" >&2 - read -r _ - fi ;; G) export GSH_NO_GETTEXT=1 From edab729a96c56d61465620751e0b9da4f2003690 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 12:57:36 +0100 Subject: [PATCH 066/103] better way to check for explicit language option and show warning --- start.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/start.sh b/start.sh index 880e882e2..c19817135 100755 --- a/start.sh +++ b/start.sh @@ -45,6 +45,7 @@ export GSH_SAVEFILE_MODE="simple" export GSH_AUTOSAVE=1 export GSH_COLOR="OK" GSH_MODE="ANONYMOUS" +GSH_EXPLICIT_LANGUAGE="false" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" @@ -102,6 +103,7 @@ do ;; L) export LANGUAGE="$OPTARG" # only works on GNU systems + GSH_EXPLICIT_LANGUAGE="true" ;; G) export GSH_NO_GETTEXT=1 @@ -275,10 +277,12 @@ Do you want to remove it and start a new game? [y/N]') " if [ "$RESET" = FALSE ] then - if [ "$#" -gt 0 ] + if [ "$#" -gt 0 ] || [ "$GSH_EXPLICIT_LANGUAGE" = true ] then args=$* - echo "$(eval_gettext 'Warning: command line arguments are ignored when continuing a game ($args)')" >&2 + [ "$#" -gt 0 ] && echo "$(eval_gettext 'Warning: command line arguments are ignored when continuing a game ($args)')" >&2 + args=$LANGUAGE + [ "$GSH_EXPLICIT_LANGUAGE" = true ] && echo "$(eval_gettext 'Warning: language is ignored when continuing a game ($args)')" >&2 echo "$(gettext 'Press Enter to continue.')" >&2 read -r _ fi From bad0ecf9adac3f267642e2337339f2f1e8dc7fbb Mon Sep 17 00:00:00 2001 From: Daniele Scasciafratte Date: Thu, 21 Nov 2024 11:20:35 +0100 Subject: [PATCH 067/103] feat(language): it updated --- i18n/it.po | 8 ++++---- i18n/start-full-help/it.txt | 15 ++++++++++++--- i18n/start-help/it.txt | 14 +++++++++++++- missions/intermediate/05_background/i18n/it.po | 2 +- missions/intermediate/06_control-C/i18n/it.po | 2 +- 5 files changed, 31 insertions(+), 10 deletions(-) diff --git a/i18n/it.po b/i18n/it.po index 75cfa594d..cf5ff581b 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -95,7 +95,7 @@ msgid "AUTOMATICALLY GENERATED ON STARTUP -- DO NOT MODIFY" msgstr "GENERATO ALL'AVVIO AUTOMATICAMENTE -- NON MODIFICARE" msgid "Available index files: " -msgstr "" +msgstr "Tutti i file index disponibili: " #, sh-format msgid "Congratulations, mission $MISSION_NB has been successfully completed!" @@ -224,11 +224,11 @@ msgstr "Ci sono dei processi fermati nella tua sessione.\n" #, sh-format msgid "Warning: command line arguments are ignored when continuing a game ($args)" -msgstr "" +msgstr "Attenzione: gli argomenti della linea di comando sono ignorati mentre si gioca ($args)" #, sh-format msgid "Warning: language is ignored when continuing a game ($args)" -msgstr "" +msgstr "Attenzione: la lingua è ignorata mentre si gioca ($args)" msgid "Warning: the file 'treasure.sh' was sourced from a subshell.\n" "You should use the command\n" @@ -331,7 +331,7 @@ msgid "total time: %s" msgstr "tempo totale: %s" msgid "use 'gsh help' to get a list of available commands" -msgstr "" +msgstr "usa 'gsh help' per avere la lista dei comandi disponibili" msgid "y" msgstr "s" diff --git a/i18n/start-full-help/it.txt b/i18n/start-full-help/it.txt index aeab87a8e..790621183 100644 --- a/i18n/start-full-help/it.txt +++ b/i18n/start-full-help/it.txt @@ -1,8 +1,17 @@ -options: +utilizzo: + $GSH_EXEC_FILE [OPZIOHNI] [INDEX_FILE1 INDEX_FILE2 ...] + +Possibili valori per INDEX_FILE sono: $GSH_INDEX_FILES. + +Se nessun INDEX_FILE è fornito, il predefinito sarà default.idx. + +I file Index sono ignorato quando si continua da un file di salvataggio. + +opzioni: -h messaggio di aiuto breve -H questo avviso -V mostra versione - -I ... + -I mostra lista dei file index disponibili -P modalitá passaporto: chiede il nome/email del giocatore -A modalitá anonima @@ -32,7 +41,7 @@ options: -q silenzioso: non mostra avvisi informativi -n bianco e nero: non usa i codici di escape ANSI per i colori - -c ... dai quel comando a GameShell (in testing) + -c ... dai quel comando a GameShell (per provare) -U scarica l'ultima versione di GameShell (richiede accesso alla rete) -X estrai solo l'archivio tgz diff --git a/i18n/start-help/it.txt b/i18n/start-help/it.txt index bdbc9fa59..b312ad50e 100644 --- a/i18n/start-help/it.txt +++ b/i18n/start-help/it.txt @@ -1,6 +1,18 @@ -options: +utilizzo: + $GSH_EXEC_FILE [OPZIONI] [INDEX_FILE1 INDEX_FILE2 ...] + +Possibili valori per INDEX_FILE sono: $GSH_INDEX_FILES. + +Se nessun INDEX_FILE è fornito, il predefinito sarà default.idx. + +I file Index sono ignorato quando si continua da un file di salvataggio. + + +opzioni principali: -h questo avviso + -H mostra tutte le opzioni disponibili -V mostra versione + -I mostra lista dei file index disponibili -R reimposta la partita -F non cercare salvataggi recenti, utilizza forzatamente l'archivio definito diff --git a/missions/intermediate/05_background/i18n/it.po b/missions/intermediate/05_background/i18n/it.po index 01d86cfb6..4a85cae10 100644 --- a/missions/intermediate/05_background/i18n/it.po +++ b/missions/intermediate/05_background/i18n/it.po @@ -40,7 +40,7 @@ msgid "Mmm... I only saw $NB fireworks. That's not enough." msgstr "Mmm... io vedo solo $NB fuochi d'artificio. Non sono sufficenti." msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." -msgstr "" +msgstr "NOTA: hai bisogno di verificare che il pirotecnico possa vedere tutti i fuochi di artificio mentre aspetta." msgid "charmiglio" msgstr "charmiglio" diff --git a/missions/intermediate/06_control-C/i18n/it.po b/missions/intermediate/06_control-C/i18n/it.po index c17f3e6d3..f806c2e2d 100644 --- a/missions/intermediate/06_control-C/i18n/it.po +++ b/missions/intermediate/06_control-C/i18n/it.po @@ -52,7 +52,7 @@ msgid "What's a valid 4 letters sequence?" msgstr "Cosa è una sequenza valida di 4 lettere?" msgid "You can stop the incantation with Control-c." -msgstr "" +msgstr "Puoi interrompere l'incantesimo con Control-C" #, sh-format msgid "usage: $command CCCC\n" From be7a7edc2606b00efeb6609a3a20d2a2486b03d9 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 10 Dec 2024 13:20:00 +0100 Subject: [PATCH 068/103] bug when copying the shell files for missions 29 and 30 when no compiler is found, the shell file were copied with a shebang of "#!/usr/bin/env bash", so that their names wasn't used by ps. (Instead, the processes appeared with a name of "bash") --- missions/processes/00_shared/init.sh | 2 +- missions/processes/01_ps_kill/init.sh | 8 ++++++-- missions/processes/02_ps_kill_signal/init.sh | 11 +++++++---- missions/processes/03_pstree_kill/init.sh | 9 ++++----- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/missions/processes/00_shared/init.sh b/missions/processes/00_shared/init.sh index e40e1f877..3d0aade6d 100644 --- a/missions/processes/00_shared/init.sh +++ b/missions/processes/00_shared/init.sh @@ -18,7 +18,7 @@ _mission_init() ( "$GSH_TMP/test-proc-name" & PID=$! name=$(my_ps $PID | grep $PID | grep -v sh | grep "test-proc-name") - # kill -9 $PID + kill -9 $PID if [ -z "$name" ] then echo "$(eval_gettext "Process names should be equal to the corresponding filename for mission \$MISSION_NAME.")" >&2 diff --git a/missions/processes/01_ps_kill/init.sh b/missions/processes/01_ps_kill/init.sh index f92c82b41..501431328 100644 --- a/missions/processes/01_ps_kill/init.sh +++ b/missions/processes/01_ps_kill/init.sh @@ -46,8 +46,12 @@ _install_script() ( fi mission_source "$MISSION_DIR/deps.sh" || return 1 - cp "$MISSION_DIR/spell.sh" "$GSH_TMP/$(gettext "spell")" - chmod 755 "$GSH_TMP/$(gettext "spell")" + # make sure the shebang for the spell.sh script is a real path to sh + # otherwise, ps will not use the filename as the process name... + sh=$(command -v sh) + echo "#! $sh" > "$GSH_TMP/$(gettext "spell")" + cat "$MISSION_DIR/spell.sh" >> "$GSH_TMP/$(gettext "spell")" + chmod +x "$GSH_TMP/$(gettext "spell")" ) if _compile || _install_script diff --git a/missions/processes/02_ps_kill_signal/init.sh b/missions/processes/02_ps_kill_signal/init.sh index 3af7450d1..bf89d59ec 100644 --- a/missions/processes/02_ps_kill_signal/init.sh +++ b/missions/processes/02_ps_kill_signal/init.sh @@ -1,7 +1,6 @@ #!/usr/bin/env sh _compile() ( - if command -v gcc >/dev/null then CC=gcc @@ -59,9 +58,13 @@ _install_script() ( return 1 fi mission_source "$MISSION_DIR/deps.sh" || return 1 - cp "$MISSION_DIR/spell.sh" "$GSH_TMP/$(gettext "spell")" - chmod 755 "$GSH_TMP/$(gettext "spell")" - + # + # make sure the shebang for the spell.sh script is a real path to sh + # otherwise, ps will not use the filename as the process name... + sh=$(command -v sh) + echo "#! $sh" > "$GSH_TMP/$(gettext "spell")" + cat "$MISSION_DIR/spell.sh" >> "$GSH_TMP/$(gettext "spell")" + chmod +x "$GSH_TMP/$(gettext "spell")" ) if _compile || _install_script diff --git a/missions/processes/03_pstree_kill/init.sh b/missions/processes/03_pstree_kill/init.sh index bcbbb13a5..d360e4568 100644 --- a/missions/processes/03_pstree_kill/init.sh +++ b/missions/processes/03_pstree_kill/init.sh @@ -1,7 +1,6 @@ #!/usr/bin/env sh _compile() ( - if ! command -v pstree >/dev/null then echo "$(eval_gettext "The command 'pstree' is required for mission \$MISSION_NAME. @@ -81,21 +80,21 @@ _install_script() ( echo "#! $sh" > "$GSH_TMP/$(gettext "nice_fairy")" cat "$MISSION_DIR/nice_fairy.sh" >> "$GSH_TMP/$(gettext "nice_fairy")" - chmod 755 "$GSH_TMP/$(gettext "nice_fairy")" + chmod +x "$GSH_TMP/$(gettext "nice_fairy")" mkdir -p "$GSH_TMP/fairy/" echo "#! $sh" > "$GSH_TMP/fairy/$(gettext "spell")" cat "$MISSION_DIR/fairy/spell.sh" >> "$GSH_TMP/fairy/$(gettext "spell")" - chmod 755 "$GSH_TMP/fairy/$(gettext "spell")" + chmod +x "$GSH_TMP/fairy/$(gettext "spell")" echo "#! $sh" > "$GSH_TMP/$(gettext "mischievous_imp")" cat "$MISSION_DIR/mischievous_imp.sh" >> "$GSH_TMP/$(gettext "mischievous_imp")" - chmod 755 "$GSH_TMP/$(gettext "mischievous_imp")" + chmod +x "$GSH_TMP/$(gettext "mischievous_imp")" mkdir -p "$GSH_TMP/imp/" echo "#! $sh" > "$GSH_TMP/imp/$(gettext "spell")" cat "$MISSION_DIR/imp/spell.sh" >> "$GSH_TMP/imp/$(gettext "spell")" - chmod 755 "$GSH_TMP/imp/$(gettext "spell")" + chmod +x "$GSH_TMP/imp/$(gettext "spell")" ) From d4e7c9e5812868362247c8de4691f3a9aa168b65 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 15:37:23 +0100 Subject: [PATCH 069/103] small fix in error reporting for missing parameters / invalid options --- i18n/en.po | 4 ++++ i18n/fr.po | 4 ++++ i18n/it.po | 4 ++++ i18n/template.pot | 4 ++++ lib/header.sh | 5 +++++ start.sh | 8 ++++++-- 6 files changed, 27 insertions(+), 2 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index 52783e498..8e948fea4 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -104,6 +104,10 @@ msgstr "Error: couldn't get mission number $MISSION_NB (from $fn_name)" msgid "Error: invalid option: '-$OPTARG'" msgstr "Error: invalid option: '-$OPTARG'" +#, sh-format +msgid "Error: missing parameter for option: '-$OPTARG'" +msgstr "Error: missing parameter for option: '-$OPTARG'" + #, sh-format msgid "Error: mission $MISSION_NB doesn't exist!" msgstr "Error: mission $MISSION_NB doesn't exist!" diff --git a/i18n/fr.po b/i18n/fr.po index b9c1c9c59..8ca74d71c 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -108,6 +108,10 @@ msgstr "Error : mission '$MISSION_NB' introuvable (dans $fn_name)" msgid "Error: invalid option: '-$OPTARG'" msgstr "Erreur : option invalide: '-$OPTARG'" +#, sh-format +msgid "Error: missing parameter for option: '-$OPTARG'" +msgstr "Erreur : paramètre manquant pour l'option : '-$OPTARG'" + #, sh-format msgid "Error: mission $MISSION_NB doesn't exist!" msgstr "Erreur : la mission $MISSION_NB n'existe pas !" diff --git a/i18n/it.po b/i18n/it.po index cf5ff581b..701841a31 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -118,6 +118,10 @@ msgstr "Errore: non é stato possibile ottenere il numero $MISSION_NB (da $fn_n msgid "Error: invalid option: '-$OPTARG'" msgstr "Errore: opzione non valida: '-$OPTARG'" +#, sh-format +msgid "Error: missing parameter for option: '-$OPTARG'" +msgstr "" + #, sh-format msgid "Error: mission $MISSION_NB doesn't exist!" msgstr "Errore: missione $MISSION_NB non esiste!" diff --git a/i18n/template.pot b/i18n/template.pot index 3f11566ee..e62365a82 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -102,6 +102,10 @@ msgstr "" msgid "Error: invalid option: '-$OPTARG'" msgstr "" +#, sh-format +msgid "Error: missing parameter for option: '-$OPTARG'" +msgstr "" + #, sh-format msgid "Error: mission $MISSION_NB doesn't exist!" msgstr "" diff --git a/lib/header.sh b/lib/header.sh index 4a1830b38..d1179bb05 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -94,6 +94,11 @@ do echo "use $0 -h to get the list of available options" >&2 exit 1 ;; + :) + echo "$0: missing parameter for option '-$OPTARG'" >&2 + echo "use $0 -h to get the list of available options" >&2 + exit 1 + ;; *) # ignore other options, they will be passed to start.sh ;; diff --git a/start.sh b/start.sh index c19817135..0d93306d4 100755 --- a/start.sh +++ b/start.sh @@ -129,12 +129,16 @@ do c) GSH_COMMAND=$OPTARG ;; + X | U) + echo "$(gettext "Error: this option is only available from an executable archive!")" >&2 + exit 1 + ;; '?') echo "$(eval_gettext "Error: invalid option: '-\$OPTARG'")" >&2 exit 1 ;; - X | U) - echo "$(gettext "Error: this option is only available from an executable archive!")" >&2 + :) + echo "$(eval_gettext "Error: missing parameter for option: '-\$OPTARG'")" >&2 exit 1 ;; *) From 90164bec4a6387d02580367cbb71740ae7397001 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 15:53:44 +0100 Subject: [PATCH 070/103] replaced -G option (no gettext) by -L "" --- i18n/start-full-help/en.txt | 4 ++-- i18n/start-full-help/fr.txt | 6 +++--- i18n/start-full-help/it.txt | 2 +- start.sh | 13 ++++++++----- utils/archive.sh | 25 ++++++++++--------------- 5 files changed, 24 insertions(+), 26 deletions(-) diff --git a/i18n/start-full-help/en.txt b/i18n/start-full-help/en.txt index 5f5a63ed1..199498c3a 100644 --- a/i18n/start-full-help/en.txt +++ b/i18n/start-full-help/en.txt @@ -23,10 +23,10 @@ options: -R reset game -F do not check for more recent savefiles, force using the given archive - -G do not use gettext for translation (everything will be in English) -L ... set LANGUAGE variable (ex: -L fr:it:en) On non GNU systems, set the variable LC_MESSAGES to a valid locale. - This flag is ignored when continuing from a save file. + -L "" gettext won't be used and everything will be in English + The -L flag is ignored when continuing from a save file. -S simple the savefile is obtained by adding a "-save" suffix, diff --git a/i18n/start-full-help/fr.txt b/i18n/start-full-help/fr.txt index d48a5730f..74e7d796e 100644 --- a/i18n/start-full-help/fr.txt +++ b/i18n/start-full-help/fr.txt @@ -25,11 +25,11 @@ options : -F ne vérifie pas l'existence de fichiers de sauvegarde plus récents, force l'utilisation de l'archive donnée - -G désactive gettext pour les traductions (tout sera en Anglais) - -L initialise la variable LANGUAGE (ex : -L fr:it:en) + -L ... initialise la variable LANGUAGE (ex : -L fr:it:en) Pour les systèmes non GNU, initialisez la variable LC_MESSAGES avec une locale valide. - Cette option est sans effet lorsqu'on reprend une session à partir + -L "" gettext ne sera pas utilisé et le jeu sera en Anglais + L'option -L est sans effet lorsqu'on reprend une session à partir d'un fichier de sauvegarde. -S simple diff --git a/i18n/start-full-help/it.txt b/i18n/start-full-help/it.txt index 790621183..5a09c2f5f 100644 --- a/i18n/start-full-help/it.txt +++ b/i18n/start-full-help/it.txt @@ -22,10 +22,10 @@ opzioni: -R reimposta la partita -F non cercare salvataggi recenti, utilizza forzatamente l'archivio definito - -G non utilizzare gettext per le traduzioni (sarà tutto in Inglese) -L ... imposta la variabile LANGUAGE (ex: -L fr:it:en) Su sistemi non GNU, imposta la variabile LC_MESSAGES per un "locale" valido. + -L "" non utilizzare gettext per le traduzioni (sarà tutto in Inglese) -S simple il file di salvataggio è generato con un suffiso "-save", diff --git a/start.sh b/start.sh index 0d93306d4..96948cb33 100755 --- a/start.sh +++ b/start.sh @@ -49,7 +49,7 @@ GSH_EXPLICIT_LANGUAGE="false" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" -while getopts ":hHInPdDACRXUVqGL:KBZc:FS:" opt +while getopts ":hHInPdDACRXUVqL:KBZc:FS:" opt do case $opt in S) @@ -102,12 +102,15 @@ do RESET="TRUE" ;; L) - export LANGUAGE="$OPTARG" # only works on GNU systems + if [ -z "$OPTARG" ] + then + export GSH_NO_GETTEXT=1 + else + export LANGUAGE="$OPTARG" # only works on GNU systems + unset GSH_NO_GETTEXT + fi GSH_EXPLICIT_LANGUAGE="true" ;; - G) - export GSH_NO_GETTEXT=1 - ;; V) # when lib/header.sh sees the -V flag, it displays the version and exits, # so the next case isn't used. diff --git a/utils/archive.sh b/utils/archive.sh index 885865f01..d1734ae40 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -15,8 +15,8 @@ options: -P use the "passport mode" by default when running GameShell -A use the "anonymous mode" by default when running GameShell -L LANGS only keep the given languages (ex: -L 'en*,fr') - -E only keep english as a language, not generating any ".mo" file - and not using gettext + if LANGS is empty (-L ""), only keep english as a language, + not generating any ".mo" file and not using gettext -N ... name of the archive / top directory (default: "gameshell") -I FILE additional index file to include in the archive @@ -67,7 +67,7 @@ VERBOSE="" INDEX_FILES="" -while getopts "hp:N:atPzL:EvS:p:I:" opt +while getopts "hp:N:atPzL:vS:p:I:" opt do case $opt in h) @@ -113,22 +113,17 @@ do ;; L) LANGUAGES=$OPTARG - ;; - E) - LANGUAGES= - KEEP_PO=0 - GENERATE_MO=0 - GSH_NO_GETTEXT=1 + if [ -z "$OPTARG" ] + then + KEEP_PO=0 + GENERATE_MO=0 + GSH_NO_GETTEXT=1 + fi ;; v) VERBOSE=1 ;; - *) - if [ "$_long_option" = "1" ] - then - OPTARG="-$opt" - fi - echo "invalid option: '-$OPTARG'" >&2 + '?' | :) exit 1 ;; esac From c6fcefd65bcbedcba3a63ca557e68434a27b8b5b Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 16:24:13 +0100 Subject: [PATCH 071/103] fix minor problem in the handling of options and parameters options -A and -P have been replaced by -M anonymous and -M passport as well --- i18n/en.po | 4 + i18n/fr.po | 4 + i18n/it.po | 4 + i18n/start-full-help/en.txt | 9 ++- i18n/start-full-help/fr.txt | 9 ++- i18n/start-full-help/it.txt | 9 ++- i18n/template.pot | 4 + lib/header.sh | 153 +++++++++++++++++++++--------------- start.sh | 22 ++++-- utils/archive.sh | 23 ++++-- 10 files changed, 152 insertions(+), 89 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index 8e948fea4..e80105cdb 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -100,6 +100,10 @@ msgstr "Error: a least one base function is not working properly.\n" msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" msgstr "Error: couldn't get mission number $MISSION_NB (from $fn_name)" +#, sh-format +msgid "Error: invalid mode (option -M): '-$OPTARG'" +msgstr "Error: invalid mode (option -M): '-$OPTARG'" + #, sh-format msgid "Error: invalid option: '-$OPTARG'" msgstr "Error: invalid option: '-$OPTARG'" diff --git a/i18n/fr.po b/i18n/fr.po index 8ca74d71c..b2edc6b77 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -104,6 +104,10 @@ msgstr "Erreur : au moins une fonction de base ne marche pas correctement.\n" msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" msgstr "Error : mission '$MISSION_NB' introuvable (dans $fn_name)" +#, sh-format +msgid "Error: invalid mode (option -M): '-$OPTARG'" +msgstr "Erreur : mode invalide (option -M) : '-$OPTARG'" + #, sh-format msgid "Error: invalid option: '-$OPTARG'" msgstr "Erreur : option invalide: '-$OPTARG'" diff --git a/i18n/it.po b/i18n/it.po index 701841a31..92bad0ba7 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -114,6 +114,10 @@ msgstr "Errore: almeno una delle funzioni base non funziona correttamente.\n" msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" msgstr "Errore: non é stato possibile ottenere il numero $MISSION_NB (da $fn_name)" +#, sh-format +msgid "Error: invalid mode (option -M): '-$OPTARG'" +msgstr "" + #, sh-format msgid "Error: invalid option: '-$OPTARG'" msgstr "Errore: opzione non valida: '-$OPTARG'" diff --git a/i18n/start-full-help/en.txt b/i18n/start-full-help/en.txt index 199498c3a..eb17b4bf3 100644 --- a/i18n/start-full-help/en.txt +++ b/i18n/start-full-help/en.txt @@ -14,10 +14,11 @@ options: -V display version -I show list of available index files - -P passport mode: ask for name / emails of player - -A anonymous mode - -d debug mode - -D verbose debug mode + -M passport passport mode: ask for name / emails of player + -M anonymous anonymous mode + -M debug debug mode + -d alias for -M debug + -D verbose debug mode -C continue current game (if relevant) -R reset game diff --git a/i18n/start-full-help/fr.txt b/i18n/start-full-help/fr.txt index 74e7d796e..997af99f2 100644 --- a/i18n/start-full-help/fr.txt +++ b/i18n/start-full-help/fr.txt @@ -15,10 +15,11 @@ options : -V affiche la version -I affiche la liste des fichier index disponibles - -P mode passeport : demande le nom / email du joueur - -D mode debug - -v lecture "verbeuse" des scripts de mission (seulement en mode debug) - -A mode anonyme + -M passport mode passeport : demande le nom / email du joueur + -M anonymous mode anonyme + -M debug mode debug + -d alias pour -M debug + -D mode debug verbeux -C continue la partie en cours (si pertinent) -R recommence une partie du début diff --git a/i18n/start-full-help/it.txt b/i18n/start-full-help/it.txt index 5a09c2f5f..b99cfb40a 100644 --- a/i18n/start-full-help/it.txt +++ b/i18n/start-full-help/it.txt @@ -13,10 +13,11 @@ opzioni: -V mostra versione -I mostra lista dei file index disponibili - -P modalitá passaporto: chiede il nome/email del giocatore - -A modalitá anonima - -d modalitá debug - -D modalitá debug verbosa + -M passport modalitá passaporto: chiede il nome/email del giocatore + -M anonymous modalitá anonima + -M debug modalitá debug + -d modalitá debug + -D modalitá debug verbosa -C continua la partita corrente (se rilevante) -R reimposta la partita diff --git a/i18n/template.pot b/i18n/template.pot index e62365a82..5ef31a939 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -98,6 +98,10 @@ msgstr "" msgid "Error: couldn't get mission number $MISSION_NB (from $fn_name)" msgstr "" +#, sh-format +msgid "Error: invalid mode (option -M): '-$OPTARG'" +msgstr "" + #, sh-format msgid "Error: invalid option: '-$OPTARG'" msgstr "" diff --git a/lib/header.sh b/lib/header.sh index d1179bb05..c3f5da4e9 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -34,75 +34,98 @@ GSH_EXEC_DIR=$(cd "$GSH_EXEC_DIR"; pwd -P) # just in case GSH_EXEC_DIR=${GSH_EXEC_DIR:-.} -while getopts ":hHInPdDACRXUVqGL:KBZc:FS:" opt +CHECK_SAVEFILE="true" + +while getopts ":hHIndDM:CRXUVqL:KBZc:FS:" opt do - case "$opt" in - V) - echo "Gameshell $GSH_VERSION" - if [ -n "$GSH_LAST_CHECKED_MISSION" ] + case "$opt" in + V) + echo "Gameshell $GSH_VERSION" + if [ -n "$GSH_LAST_CHECKED_MISSION" ] + then + echo "saved game: [mission $GSH_LAST_CHECKED_MISSION] OK" + fi + exit 0 + ;; + U) + TARGET="$GSH_EXEC_DIR/gameshell.sh" + TMPFILE="$GSH_EXEC_DIR/gameshell.sh$$" + if command -v wget >/dev/null + then + if wget -O "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh then - echo "saved game: [mission $GSH_LAST_CHECKED_MISSION] OK" + mv "$TMPFILE" "$TARGET" + chmod +x "$TARGET" + echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" + exit 0 + else + rm -f "$TMPFILE" + echo "Error: couldn't download or save the latest version of GameShell." >&2 + exit 1 fi - exit 0 - ;; - U) - TARGET="$GSH_EXEC_DIR/gameshell.sh" - TMPFILE="$GSH_EXEC_DIR/gameshell.sh$$" - if command -v wget >/dev/null + elif command -v curl >/dev/null + then + if curl -fo "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh then - if wget -O "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh - then - mv "$TMPFILE" "$TARGET" - chmod +x "$TARGET" - echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" - exit 0 - else - rm -f "$TMPFILE" - echo "Error: couldn't download or save the latest version of GameShell." >&2 - exit 1 - fi - elif command -v curl >/dev/null - then - if curl -fo "$TMPFILE" https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh - then - mv "$TMPFILE" "$TARGET" - chmod +x "$TARGET" - echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" - exit 0 - else - rm -f "$TMPFILE" - echo "Error: couldn't download or save the latest version of GameShell." >&2 - exit 1 - fi + mv "$TMPFILE" "$TARGET" + chmod +x "$TARGET" + echo "Latest version of GameShell downloaded to $GSH_EXEC_DIR/gameshell.sh" + exit 0 + else + rm -f "$TMPFILE" + echo "Error: couldn't download or save the latest version of GameShell." >&2 + exit 1 fi - ;; - X) - GSH_EXTRACT="true" - ;; - K) - KEEP_DIR="true" - ;; - F) - GSH_FORCE="true" - ;; - h | H | I) - # used to avoid checking for more recent files - GSH_HELP="true" - ;; - '?') - echo "$0: invalid option '-$OPTARG'" >&2 - echo "use $0 -h to get the list of available options" >&2 - exit 1 - ;; - :) - echo "$0: missing parameter for option '-$OPTARG'" >&2 - echo "use $0 -h to get the list of available options" >&2 - exit 1 - ;; - *) - # ignore other options, they will be passed to start.sh - ;; - esac + fi + ;; + X) + GSH_EXTRACT="true" + ;; + K) + KEEP_DIR="true" + ;; + F) + GSH_FORCE="true" + ;; + h | H | I) + # used to avoid checking for more recent files + CHECK_SAVEFILE="false" + ;; + + S) + # the next cases are used to check validity of parameters, to avoid + # checking for savefiles the error message will be displayed with + # appropriate language by start.sh + case "$OPTARG" in + "index" | "simple" | "overwrite") + : + ;; + *) + CHECK_SAVEFILE="false" + ;; + esac + ;; + M) + case "$OPTARG" in + passport | anonymous | debug) + : + ;; + *) + CHECK_SAVEFILE="false" + ;; + esac + ;; + + '?') + CHECK_SAVEFILE="false" + ;; + :) + CHECK_SAVEFILE="false" + ;; + *) + # ignore other options, they will be passed to start.sh + ;; + esac done @@ -115,7 +138,7 @@ GSH_NAME=${GSH_NAME%-save*} GSH_NAME=$(basename "$GSH_NAME") -if [ "$GSH_HELP" != "true" ] && [ "$GSH_FORCE" != "true" ] +if [ "$CHECK_SAVEFILE" = "true" ] && [ "$GSH_FORCE" != "true" ] then LAST_SAVEFILE=$(ls "$GSH_EXEC_DIR/$GSH_NAME-save"*".$EXT" 2>/dev/null | sort | tail -n 1) diff --git a/start.sh b/start.sh index 96948cb33..bc6638cdf 100755 --- a/start.sh +++ b/start.sh @@ -49,7 +49,7 @@ GSH_EXPLICIT_LANGUAGE="false" # if GSH_NO_GETTEXT is non-empty, gettext won't be used anywhere, the only language will thus be English # export GSH_NO_GETTEXT=1 # DO NOT CHANGE OR REMOVE THIS LINE, it is used by utils/archive.sh RESET="" -while getopts ":hHInPdDACRXUVqL:KBZc:FS:" opt +while getopts ":hHIndDM:CRXUVqL:KBZc:FS:" opt do case $opt in S) @@ -79,8 +79,21 @@ do n) GSH_COLOR="" ;; - P) - GSH_MODE="PASSPORT" + M) + case "$OPTARG" in + passport) + GSH_MODE="PASSPORT" + ;; + anonymous) + GSH_MODE="ANONYMOUS" + ;; + debug) + GSH_MODE="debug" + ;; + *) + echo "$(eval_gettext "Error: invalid mode (option -M): '-\$OPTARG'")" >&2 + exit 1 + esac ;; d) GSH_MODE="DEBUG" @@ -92,9 +105,6 @@ do q) export GSH_QUIET_INTRO="true" ;; - A) - GSH_MODE="ANONYMOUS" - ;; C) RESET="FALSE" ;; diff --git a/utils/archive.sh b/utils/archive.sh index d1734ae40..8443b33b6 100755 --- a/utils/archive.sh +++ b/utils/archive.sh @@ -12,8 +12,8 @@ options: -h this message -p ... choose password for admin commands - -P use the "passport mode" by default when running GameShell - -A use the "anonymous mode" by default when running GameShell + -M passport use the "passport mode" by default when running GameShell + -M anonymous use the "anonymous mode" by default when running GameShell -L LANGS only keep the given languages (ex: -L 'en*,fr') if LANGS is empty (-L ""), only keep english as a language, not generating any ".mo" file and not using gettext @@ -67,7 +67,7 @@ VERBOSE="" INDEX_FILES="" -while getopts "hp:N:atPzL:vS:p:I:" opt +while getopts "hp:N:atM:zL:vS:p:I:" opt do case $opt in h) @@ -94,7 +94,7 @@ do I) if [ "$OPTARG" = "default.idx" ] then - echo "Warning: ignoring additional index file with name '$OPTARG'" + echo "Warning: ignoring additional index file with name '$OPTARG'" >&2 else INDEX_FILES="$INDEX_FILES:$OPTARG" fi @@ -105,8 +105,19 @@ do t) KEEP_TEST=1 ;; - P) - DEFAULT_MODE="PASSPORT" + M) + case "$OPTARG" in + passport) + DEFAULT_MODE="PASSPORT" + ;; + anonymous) + DEFAULT_MODE="ANONYMOUS" + ;; + *) + echo "Error: default mode (option -M) can only be 'anonymous' or 'passport' (got '$OPTARG')" >&2 + exit 1 + ;; + esac ;; z) KEEP_TGZ=1 From 5ebd8d8f513117a48789248167baafdb21bc7d81 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 19 Nov 2024 15:37:46 +0100 Subject: [PATCH 072/103] ignore gameshell* pattern only in root directory --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index cf9eb3a8e..700671828 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,6 @@ TODO World locale/ *~ -gameshell* +/gameshell* game shell* boxes-data.awk From d0963a76241289b5860c774831285e7b43196685 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 19 Nov 2024 16:19:26 +0100 Subject: [PATCH 073/103] not consistent with case for variables in help messages --- i18n/gameshell-full-help/en.txt | 6 +++--- i18n/gameshell-full-help/fr.txt | 6 +++--- i18n/gameshell-full-help/it.txt | 6 +++--- i18n/gameshell-help/en.txt | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/i18n/gameshell-full-help/en.txt b/i18n/gameshell-full-help/en.txt index 018ebd192..56adb23e5 100644 --- a/i18n/gameshell-full-help/en.txt +++ b/i18n/gameshell-full-help/en.txt @@ -1,11 +1,11 @@ Commands specific to GameShell ============================== -gsh assert condition [msg] +gsh assert condition [MSG] check if the condition is true if not, display an error message -gsh assert check true/false [msg] +gsh assert check true/false [MSG] check the current mission's goal has been achieved if the result doesn't coincide with the expected result, display an error message @@ -27,7 +27,7 @@ gsh goal [N] show the current mission's goal if N is given, show the goal for mission N -gsh goto N (ADMIN) +gsh goto [N] (ADMIN) directly go to mission N (no password necessary if N is a previous mission) diff --git a/i18n/gameshell-full-help/fr.txt b/i18n/gameshell-full-help/fr.txt index 2ee5c4597..c38684871 100644 --- a/i18n/gameshell-full-help/fr.txt +++ b/i18n/gameshell-full-help/fr.txt @@ -1,11 +1,11 @@ Commandes propres à GameShell ============================= -gsh assert condition [msg] +gsh assert condition [MSG] vérifie si la condition est vraie, sinon, affiche un message d'erreur -gsh assert_check true/false [msg] +gsh assert_check true/false [MSG] vérifie si l'objectif de la mission en cours est atteint si le résultat ne correspond pas au résultat attendu, affiche un message d'erreur @@ -26,7 +26,7 @@ gsh goal [N] affiche l'objectif de la mission en cours si N est donné, affiche l'objectif de la mission N -gsh goto N (ADMIN) +gsh goto [N] (ADMIN) passe directement à la mission N (le mot de passe n'est pas nécessaire si N est une mission précédente) diff --git a/i18n/gameshell-full-help/it.txt b/i18n/gameshell-full-help/it.txt index 54c926b38..fefcc545b 100644 --- a/i18n/gameshell-full-help/it.txt +++ b/i18n/gameshell-full-help/it.txt @@ -1,11 +1,11 @@ Comandi specifici di GameShell ============================== -gsh assert condition [msg] +gsh assert condition [MSG] verifica se la condizione è vera altrimenti mostra un messaggio di errore -gsh assert check true/false [msg] +gsh assert check true/false [MSG] verifica se gli obiettivi della missione corrente sono stati raggiunti se il risultato non coincide con quello aspettato mostra un messaggio di errore @@ -29,7 +29,7 @@ gsh goal [N] mostra gli obiettivi della missione se N è fornito, mostra gli obiettivi della missione N -gsh goto N (ADMIN) +gsh goto [N] (ADMIN) vai direttamente alla missione N (nessuna password necessaria se N è la precedente) diff --git a/i18n/gameshell-help/en.txt b/i18n/gameshell-help/en.txt index c3af6de8f..c9af61b22 100644 --- a/i18n/gameshell-help/en.txt +++ b/i18n/gameshell-help/en.txt @@ -10,9 +10,9 @@ gsh exit / Control-d (you can start from the current mission by running GameShell with the "-C" flag) -gsh goal [n] +gsh goal [N] show the current mission's goal - if n is given, show the goal for mission n + if n is given, show the goal for mission N gsh help shorter help message From 5faf62671f847e0e0b5bf343df4b60d1d9bbf81f Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Wed, 20 Nov 2024 22:26:28 +0100 Subject: [PATCH 074/103] message to show where file was saved on exit --- i18n/en.po | 4 ++++ i18n/fr.po | 4 ++++ i18n/it.po | 4 ++++ i18n/template.pot | 4 ++++ missions/FINAL_MISSION/init.sh | 2 +- scripts/_gsh_save | 6 +++++- 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index e80105cdb..318601640 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -312,6 +312,10 @@ msgstr "optional" msgid "password:" msgstr "password:" +#, sh-format +msgid "progress was saved in $SAVEFILE" +msgstr "progress was saved in $SAVEFILE" + msgid "skipped" msgstr "skipped" diff --git a/i18n/fr.po b/i18n/fr.po index b2edc6b77..8b8c400a5 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -319,6 +319,10 @@ msgstr "facultatif" msgid "password:" msgstr "mot de passe :" +#, sh-format +msgid "progress was saved in $SAVEFILE" +msgstr "la progression a été sauvée dans $SAVEFILE" + msgid "skipped" msgstr "sautée" diff --git a/i18n/it.po b/i18n/it.po index 92bad0ba7..fe6f18822 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -327,6 +327,10 @@ msgstr "facoltativo" msgid "password:" msgstr "password:" +#, sh-format +msgid "progress was saved in $SAVEFILE" +msgstr "" + msgid "skipped" msgstr "saltate" diff --git a/i18n/template.pot b/i18n/template.pot index 5ef31a939..81f61ac3b 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -295,6 +295,10 @@ msgstr "" msgid "password:" msgstr "" +#, sh-format +msgid "progress was saved in $SAVEFILE" +msgstr "" + msgid "skipped" msgstr "" diff --git a/missions/FINAL_MISSION/init.sh b/missions/FINAL_MISSION/init.sh index ac4f583b5..64f08659a 100644 --- a/missions/FINAL_MISSION/init.sh +++ b/missions/FINAL_MISSION/init.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh -if [ "$GSH_MODE" = DEBUG ] +if [ "$GSH_MODE" = DEBUG ] || [ -n "$GSH_QUIET_INTRO" ] then color_echo green "$(eval_gettext "CONGRATULATION, you've finished the game!")" echo diff --git a/scripts/_gsh_save b/scripts/_gsh_save index 7d9ebf779..15cbc0594 100755 --- a/scripts/_gsh_save +++ b/scripts/_gsh_save @@ -1,5 +1,7 @@ #!/usr/bin/env sh +. gsh_gettext.sh + ### # NOTE: this function should only be called after a "clean" @@ -34,7 +36,7 @@ fi if [ "$GSH_MODE" = "DEBUG" ] then - echo "[ saving progress to file $SAVEFILE ]" + echo "[ preparing save file ]" fi # record last checked mission @@ -50,6 +52,8 @@ chmod +x "$SAVEFILE" rm --system -f "$SAVEFILE.tgz" +echo "[ $(eval_gettext 'progress was saved in $SAVEFILE') ]" + if [ "$ARCHIVE_OK" -ne 0 ] || [ "$SAVE_OK" -ne 0 ] then echo "SAVEFILE MIGHT BE INCORRECT" From bc223ea1fd12ea5376c89e67d5f03b78501caa78 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 13 Mar 2025 10:38:57 +0100 Subject: [PATCH 075/103] minor correction in goal messages for new missions --- missions/intermediate/05_background/goal/en.txt | 2 +- missions/intermediate/05_background/goal/fr.txt | 8 ++++---- missions/intermediate/05_background/goal/it.txt | 2 +- missions/intermediate/06_control-C/goal/en.txt | 2 +- missions/intermediate/06_control-C/goal/it.txt | 12 ++++++------ 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt index f6b7e9595..cdb9837c6 100644 --- a/missions/intermediate/05_background/goal/en.txt +++ b/missions/intermediate/05_background/goal/en.txt @@ -2,7 +2,7 @@ Mission goal ============ The king's pyrotechnician appears next to you. He asks you to fire **at least -3 of them** so he can see them from far away. +3 consecutive fireworks** so he can see them from far away. A single firework can be created with the magical word diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt index 96ef02cd7..1af5535fe 100644 --- a/missions/intermediate/05_background/goal/fr.txt +++ b/missions/intermediate/05_background/goal/fr.txt @@ -1,12 +1,12 @@ Objectif ========= -L'artificier royal apparait à vos cotés. Il vous demande de tirer **au moins 3 -jeux d'artifices" pour qu'il puisse les voir de loin. +L'artificier royal apparait à vos cotés. Il vous demande de tirer **au moins 3 +jeux d'artifices consécutifs** pour qu'il puisse les voir de loin. Une fusée simple peut être lancée avec le mot magique - $command + $command Commandes utiles @@ -16,7 +16,7 @@ $command Cette commande (non standard) lance un feu d'artifice simple. COMMANDE & - Exécute la commande mais n'attend pas qu'elle soit terminée pour reprendre + Exécute la commande mais n'attend pas qu'elle soit terminée pour reprendre l'exécution du shell. La commande s'exécute "en arrière plan". diff --git a/missions/intermediate/05_background/goal/it.txt b/missions/intermediate/05_background/goal/it.txt index 9fc94fa40..f29f4e933 100644 --- a/missions/intermediate/05_background/goal/it.txt +++ b/missions/intermediate/05_background/goal/it.txt @@ -1,7 +1,7 @@ Obiettivi missione ============ -IL pirotecnico del re appare vicino a te. Ti chiede se ne puoi accendere **almeno +Il pirotecnico del re appare vicino a te. Ti chiede se ne puoi accendere **almeno 3** così che possa vederli da lontano. Un singolo fuoco d'artificio può essere acceso con: diff --git a/missions/intermediate/06_control-C/goal/en.txt b/missions/intermediate/06_control-C/goal/en.txt index 3b6edee23..812f3fc54 100644 --- a/missions/intermediate/06_control-C/goal/en.txt +++ b/missions/intermediate/06_control-C/goal/en.txt @@ -3,7 +3,7 @@ Mission goal The king's pyrotechnician is trying to remember the magical incantation for creating the grand finale for his fireworks. This incantation starts -with the work $command and must be followed by four random letters, as +with the word $command and must be followed by four random letters, as in $ $command abcd diff --git a/missions/intermediate/06_control-C/goal/it.txt b/missions/intermediate/06_control-C/goal/it.txt index 05c45c187..ea01be0d1 100644 --- a/missions/intermediate/06_control-C/goal/it.txt +++ b/missions/intermediate/06_control-C/goal/it.txt @@ -1,8 +1,8 @@ Obiettivi missione ============ -Il pirotecnico del re sta cercando di rcordarsi gli incantesimi magici -per creare il gran finale per il suo spettacolo. Questo incantesimo comincia +Il pirotecnico del re sta cercando di rcordarsi gli incantesimi magici +per creare il gran finale per il suo spettacolo. Questo incantesimo comincia il lavoro $command e deve essere seguito da 4 lettere casuali come $ $command abcd @@ -12,10 +12,10 @@ o Aiuta il pirotecnico trovando 4 lettere per lanciare i fuochi giusti. -NOTA: quando le quattro lettere sono sbagliate, la reazione magica +NOTA: quando le quattro lettere sono sbagliate, la reazione magica può richiedere molto tempo. Devi interromperla! -Sarà necessario provare diverse volte per trovare la combinazione giusta di +Sarà necessario provare diverse volte per trovare la combinazione giusta di lettere che funziona. @@ -25,9 +25,9 @@ Comandi utili $command CCCC questo comando (non standard) create alcuni fuochi d'artificio - se le quattro lettere sono valide, i fuochi cominceranno dopo pochi secondi - - se le quattro lettere non sono valide, la reazione magica richiederà molto + - se le quattro lettere non sono valide, la reazione magica richiederà molto tempo per fallire Control-c (scritto anche come ^c) - premendo Control e c allo stesso tempo interrompe il comando attuale + premendo Control e c allo stesso tempo interrompe il comando attuale inviando il segnale di INTerruzione al processo From bc8fc2458277546bf1973e58ffab152604fcec98 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 14 Mar 2025 08:45:20 +0100 Subject: [PATCH 076/103] rename spells charmiglio / Charmiglio to flarigo / charmiglio to avoid confusion (player using charmiglio instead of Charmiglio in the second mission) --- missions/intermediate/05_background/auto.sh | 2 +- missions/intermediate/05_background/check.sh | 4 ++-- .../05_background/{charmiglio.sh => flarigo.sh} | 6 +++--- missions/intermediate/05_background/goal.sh | 2 +- missions/intermediate/05_background/i18n/en.po | 4 ++-- missions/intermediate/05_background/i18n/fr.po | 4 ++-- missions/intermediate/05_background/i18n/it.po | 4 ++-- .../intermediate/05_background/i18n/template.pot | 2 +- missions/intermediate/05_background/init.sh | 2 +- missions/intermediate/05_background/test.sh | 12 ++++++------ missions/intermediate/06_control-C/auto.sh | 2 +- .../06_control-C/{Charmiglio.sh => charmiglio.sh} | 2 +- missions/intermediate/06_control-C/goal.sh | 2 +- missions/intermediate/06_control-C/i18n/en.po | 4 ++-- missions/intermediate/06_control-C/i18n/fr.po | 4 ++-- missions/intermediate/06_control-C/i18n/it.po | 4 ++-- missions/intermediate/06_control-C/i18n/template.pot | 2 +- missions/intermediate/06_control-C/init.sh | 2 +- missions/intermediate/06_control-C/test.sh | 2 +- 19 files changed, 33 insertions(+), 33 deletions(-) rename missions/intermediate/05_background/{charmiglio.sh => flarigo.sh} (76%) rename missions/intermediate/06_control-C/{Charmiglio.sh => charmiglio.sh} (98%) diff --git a/missions/intermediate/05_background/auto.sh b/missions/intermediate/05_background/auto.sh index f6a5358a8..acc589969 100644 --- a/missions/intermediate/05_background/auto.sh +++ b/missions/intermediate/05_background/auto.sh @@ -2,4 +2,4 @@ # set -m -charmiglio & charmiglio & charmiglio & gsh check +flarigo & flarigo & flarigo & gsh check diff --git a/missions/intermediate/05_background/check.sh b/missions/intermediate/05_background/check.sh index c316c2542..f8ff314f2 100644 --- a/missions/intermediate/05_background/check.sh +++ b/missions/intermediate/05_background/check.sh @@ -1,8 +1,8 @@ #!/usr/bin/env sh -command="$(gettext 'charmiglio')" +command="$(gettext 'flarigo')" -PIDS=$GSH_TMP/charmiglio.pids +PIDS=$GSH_TMP/flarigo.pids _check() { rm -f "$PIDS" diff --git a/missions/intermediate/05_background/charmiglio.sh b/missions/intermediate/05_background/flarigo.sh similarity index 76% rename from missions/intermediate/05_background/charmiglio.sh rename to missions/intermediate/05_background/flarigo.sh index e7b34bacd..43debb86f 100755 --- a/missions/intermediate/05_background/charmiglio.sh +++ b/missions/intermediate/05_background/flarigo.sh @@ -2,13 +2,13 @@ . gsh_gettext.sh -command=$(gettext "charmiglio") +command=$(gettext "flarigo") file="$MISSION_DIR/ascii-art/f$((1 + $(RANDOM)%6))" indent=$(echo " " | head -c "$((2 + 4 * ($(RANDOM)%8)))") -rm -f "$GSH_TMP/charmiglio.pids" +rm -f "$GSH_TMP/flarigo.pids" for i in $(seq $((5 + $(RANDOM)%5))) do echo "$indent *" @@ -17,7 +17,7 @@ done awk -v indent="$indent" '{print indent, $0}' < "$file" -echo $$ >> "$GSH_TMP/charmiglio.pids" +echo $$ >> "$GSH_TMP/flarigo.pids" sleep 1 diff --git a/missions/intermediate/05_background/goal.sh b/missions/intermediate/05_background/goal.sh index 96b1d9582..818817ad5 100644 --- a/missions/intermediate/05_background/goal.sh +++ b/missions/intermediate/05_background/goal.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -command="$(gettext 'charmiglio')" +command="$(gettext 'flarigo')" sed "s/\\\$command/$command/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" unset command diff --git a/missions/intermediate/05_background/i18n/en.po b/missions/intermediate/05_background/i18n/en.po index d02300ea1..19d8bdafc 100644 --- a/missions/intermediate/05_background/i18n/en.po +++ b/missions/intermediate/05_background/i18n/en.po @@ -33,5 +33,5 @@ msgstr "Mmm... I only saw $NB fireworks. That's not enough." msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." msgstr "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." -msgid "charmiglio" -msgstr "charmiglio" +msgid "flarigo" +msgstr "flarigo" diff --git a/missions/intermediate/05_background/i18n/fr.po b/missions/intermediate/05_background/i18n/fr.po index ccbb8b136..7e7d826df 100644 --- a/missions/intermediate/05_background/i18n/fr.po +++ b/missions/intermediate/05_background/i18n/fr.po @@ -32,5 +32,5 @@ msgstr "Mmm... Je n'ai vu que $NB feux d'artifices. Ce n'est pas assez." msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." msgstr "NOTE : vous devez vous débrouiller pour que l'artificier voie tous les feux d'artifice pendant qu'il attend." -msgid "charmiglio" -msgstr "charmiglio" +msgid "flarigo" +msgstr "flarigo" diff --git a/missions/intermediate/05_background/i18n/it.po b/missions/intermediate/05_background/i18n/it.po index 4a85cae10..9a1bd7709 100644 --- a/missions/intermediate/05_background/i18n/it.po +++ b/missions/intermediate/05_background/i18n/it.po @@ -42,5 +42,5 @@ msgstr "Mmm... io vedo solo $NB fuochi d'artificio. Non sono sufficenti." msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." msgstr "NOTA: hai bisogno di verificare che il pirotecnico possa vedere tutti i fuochi di artificio mentre aspetta." -msgid "charmiglio" -msgstr "charmiglio" +msgid "flarigo" +msgstr "flarigo" diff --git a/missions/intermediate/05_background/i18n/template.pot b/missions/intermediate/05_background/i18n/template.pot index 8f71731b3..06fcccd80 100644 --- a/missions/intermediate/05_background/i18n/template.pot +++ b/missions/intermediate/05_background/i18n/template.pot @@ -32,5 +32,5 @@ msgstr "" msgid "NOTE: you need to make sure the pyrotechnician sees all the fireworks while he is waiting." msgstr "" -msgid "charmiglio" +msgid "flarigo" msgstr "" diff --git a/missions/intermediate/05_background/init.sh b/missions/intermediate/05_background/init.sh index 4e0fba64f..bac46a30a 100644 --- a/missions/intermediate/05_background/init.sh +++ b/missions/intermediate/05_background/init.sh @@ -1,6 +1,6 @@ #!/usr/bin/env sh _mission_init() { - copy_bin "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" + copy_bin "$MISSION_DIR/flarigo.sh" "$GSH_BIN/$(gettext flarigo)" } _mission_init diff --git a/missions/intermediate/05_background/test.sh b/missions/intermediate/05_background/test.sh index 3c8de8362..dc090d2a7 100644 --- a/missions/intermediate/05_background/test.sh +++ b/missions/intermediate/05_background/test.sh @@ -3,15 +3,15 @@ # set -m gsh assert check false -charmiglio & gsh assert check false -charmiglio & charmiglio & gsh assert check false -charmiglio & charmiglio & charmiglio & gsh assert check true -charmiglio & charmiglio & charmiglio & charmiglio & gsh assert check true +flarigo & gsh assert check false +flarigo & flarigo & gsh assert check false +flarigo & flarigo & flarigo & gsh assert check true +flarigo & flarigo & flarigo & flarigo & gsh assert check true -charmiglio & charmiglio & charmiglio +flarigo & flarigo & flarigo gsh assert check false -charmiglio; charmiglio; charmiglio +flarigo; flarigo; flarigo gsh assert check false diff --git a/missions/intermediate/06_control-C/auto.sh b/missions/intermediate/06_control-C/auto.sh index 6293bb965..5711ab6a1 100644 --- a/missions/intermediate/06_control-C/auto.sh +++ b/missions/intermediate/06_control-C/auto.sh @@ -4,7 +4,7 @@ for c in a b c d e f do - eval "$(gettext Charmiglio) $c$c$c$c &" 2>/dev/null + eval "$(gettext charmiglio) $c$c$c$c &" 2>/dev/null PID=$! sleep 4 # NOTE: SIGINT signal doesn't work on non-interactive systems diff --git a/missions/intermediate/06_control-C/Charmiglio.sh b/missions/intermediate/06_control-C/charmiglio.sh similarity index 98% rename from missions/intermediate/06_control-C/Charmiglio.sh rename to missions/intermediate/06_control-C/charmiglio.sh index 81c2275cd..cbc9abf5d 100755 --- a/missions/intermediate/06_control-C/Charmiglio.sh +++ b/missions/intermediate/06_control-C/charmiglio.sh @@ -98,7 +98,7 @@ check() { init() { case "$CODE" in "") - command=$(gettext "Charmiglio") + command=$(gettext "charmiglio") echo "$(eval_gettext 'usage: $command CCCC where CCCC is a sequence of 4 ASCII letters (a-zA-Z)')" exit 1 diff --git a/missions/intermediate/06_control-C/goal.sh b/missions/intermediate/06_control-C/goal.sh index 2edb9b32c..96b1d9582 100644 --- a/missions/intermediate/06_control-C/goal.sh +++ b/missions/intermediate/06_control-C/goal.sh @@ -1,5 +1,5 @@ #!/usr/bin/env sh -command="$(gettext 'Charmiglio')" +command="$(gettext 'charmiglio')" sed "s/\\\$command/$command/g" "$(eval_gettext '$MISSION_DIR/goal/en.txt')" unset command diff --git a/missions/intermediate/06_control-C/i18n/en.po b/missions/intermediate/06_control-C/i18n/en.po index b40f80efe..8c04e3f78 100644 --- a/missions/intermediate/06_control-C/i18n/en.po +++ b/missions/intermediate/06_control-C/i18n/en.po @@ -16,8 +16,8 @@ msgstr "$MISSION_DIR/skip/en.txt" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/en.txt" -msgid "Charmiglio" -msgstr "Charmiglio" +msgid "charmiglio" +msgstr "charmiglio" #, sh-format msgid "It works! The special incantation is $CODE" diff --git a/missions/intermediate/06_control-C/i18n/fr.po b/missions/intermediate/06_control-C/i18n/fr.po index d0346d7a8..70b9732ef 100644 --- a/missions/intermediate/06_control-C/i18n/fr.po +++ b/missions/intermediate/06_control-C/i18n/fr.po @@ -15,8 +15,8 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" -msgid "Charmiglio" -msgstr "Charmiglio" +msgid "charmiglio" +msgstr "charmiglio" #, sh-format msgid "It works! The special incantation is $CODE" diff --git a/missions/intermediate/06_control-C/i18n/it.po b/missions/intermediate/06_control-C/i18n/it.po index f806c2e2d..8a2f1f5b5 100644 --- a/missions/intermediate/06_control-C/i18n/it.po +++ b/missions/intermediate/06_control-C/i18n/it.po @@ -25,8 +25,8 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" -msgid "Charmiglio" -msgstr "Charmiglio" +msgid "charmiglio" +msgstr "charmiglio" #, sh-format msgid "It works! The special incantation is $CODE" diff --git a/missions/intermediate/06_control-C/i18n/template.pot b/missions/intermediate/06_control-C/i18n/template.pot index 883b8463c..ebac810a6 100644 --- a/missions/intermediate/06_control-C/i18n/template.pot +++ b/missions/intermediate/06_control-C/i18n/template.pot @@ -15,7 +15,7 @@ msgstr "" msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" -msgid "Charmiglio" +msgid "charmiglio" msgstr "" #, sh-format diff --git a/missions/intermediate/06_control-C/init.sh b/missions/intermediate/06_control-C/init.sh index d081f8ddb..15be7bacd 100644 --- a/missions/intermediate/06_control-C/init.sh +++ b/missions/intermediate/06_control-C/init.sh @@ -5,6 +5,6 @@ _mission_init() { echo $((2 + $(RANDOM) % 3)) > "$GSH_TMP/control-C" rm -f "$GSH_TMP/control-C.codes" - copy_bin "$MISSION_DIR/Charmiglio.sh" "$GSH_BIN/$(gettext Charmiglio)" + copy_bin "$MISSION_DIR/charmiglio.sh" "$GSH_BIN/$(gettext charmiglio)" } _mission_init diff --git a/missions/intermediate/06_control-C/test.sh b/missions/intermediate/06_control-C/test.sh index c4d566a2d..d320f06e4 100644 --- a/missions/intermediate/06_control-C/test.sh +++ b/missions/intermediate/06_control-C/test.sh @@ -8,7 +8,7 @@ do_test() { for c in $(echo "a b c d e f g h i j" | cut -d' ' -f1-$nb) do - eval "$(gettext Charmiglio) $c$c$c$c &" 2>/dev/null + eval "$(gettext charmiglio) $c$c$c$c &" 2>/dev/null PID=$! sleep "$delay" # NOTE: SIGINT signal doesn't work on non-interactive systems From dd6f09d3cfc6a2100704689f318fd3ff48abf342 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 14 Mar 2025 11:05:15 +0100 Subject: [PATCH 077/103] remove blank lines from book of potions it is not always clear to the player whether their output has blank lines that should be removed. --- .../00_shared/book_of_potions/en.txt | 93 +++++++++---------- .../00_shared/book_of_potions/fr.txt | 93 +++++++++---------- .../00_shared/book_of_potions/it.txt | 51 +++++----- .../00_shared/sbin/install_potion_book.sh | 1 + .../05_pipe_head_tail/test.sh | 2 +- 5 files changed, 120 insertions(+), 120 deletions(-) diff --git a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/en.txt b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/en.txt index ad8721406..7f4c95afc 100644 --- a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/en.txt +++ b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/en.txt @@ -11,9 +11,9 @@ 11. Distilled water --------------------------------- page 13 12. King's ale -------------------------------------- Page 13 == page 1 =================================================== +vvvvvvvvvvvvvvvvvvvvv Transformation potion ---------------------- - +^^^^^^^^^^^^^^^^^^^^^ 1) Boil water in a cauldron. 2) Add 3 measures of fluxweed to the cauldron. 3) Add 2 bundles of knotgrass to the cauldron. @@ -35,11 +35,10 @@ Transformation potion 18) Add a pieces of the person you wish to become. 19) Wave your wand to complete the potion. == page 3 =================================================== +vvvvvvvvvvvvvvv Elixir of youth ---------------- - -Warning: **do not** drink if you are older than 30. - +^^^^^^^^^^^^^^^ +WARNING: **do not** drink if you are older than 30. 1) Fill a cauldron with used bath water. 2) Put a moderately large frog in the water. 3) Let the preparation rest overnight. @@ -58,53 +57,54 @@ Warning: **do not** drink if you are older than 30. 15) Add a few larch tree needles for seasoning. 16) Drink the potion from the cauldron. == page 5 =================================================== +vvv/ Ph/ --/ -/ - -\ -/ -\ -/ -\ -7\ -8/ -/ +^/ +/ + +\ +/ +\ +/ +\ +7\ +8/ +/ == page 6 =================================================== +vv\ Bot/ ---/ -_/ -\ -/ -\ -/ - -\ -/ -\ +^^/ +_/ +\ +/ +\ +/ + +\ +/ +\ == page 7 =================================================== +vvvvvvvvvv Herbal tea ----------- - +^^^^^^^^^^ 1) Boil water. 2) Add herbs from the forest. 3) Let it sit for five minutes and drink while hot. - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Draft of invisibility (instruction in invisible ink) ----------------------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + . ` . - ' + ' == page 8 =================================================== ' . ' ' ` - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Homeopathic healing potion (part 1) ------------------------------------ - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Grind whatever caused harm to thin dust. 2) Put the dust in a big cauldron. 3) Fill the cauldron with water. @@ -122,9 +122,9 @@ Homeopathic healing potion (part 1) 15) Empty the cauldron in the sewer. 16) Fill the cauldron with water. == page 10 ================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Homeopathic healing potion (part 2) ------------------------------------ - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Continue by emptying the cauldron. 2) Fill the cauldron with water. 3) Empty the cauldron in the sewer. @@ -135,9 +135,9 @@ Homeopathic healing potion (part 2) 8) Fill the cauldron with water. 9) Empty the cauldron in the sewer. == page 11 ================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Homeopathic healing potion (part 3) ------------------------------------ - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Empty the cauldron again (almost done). 2) Fill the cauldron with water. 3) Empty the cauldron in the sewer. @@ -148,9 +148,9 @@ Homeopathic healing potion (part 3) 8) Fill the cauldron with water. 9) Pour the contents of the cauldron in a flask and drink. == page 12 ================================================== +vvvvvvvvvvvvvv Toadstool stew --------------- - +^^^^^^^^^^^^^^ 1) Boil water in a cauldron. 2) Add in a few death caps (Amanita phalloides). 3) Also add a few fly agarics (Amanita muscaria). @@ -161,15 +161,14 @@ Toadstool stew 8) Season with a pinch of salt and a few herbs. 9) Serve hot in a bowl. == page 13 ================================================== +vvvvvvvvvvvvvvv Distilled water ---------------- - +^^^^^^^^^^^^^^^ 1) Boil water in a big pot. 2) Condense the vapor in a fresh container. 3) Add minerals for a better taste (optional). - +vvvvvvvvvv King's ale ----------- - +^^^^^^^^^^ 1) Go to the castle's cellar and grab a bottle. 2) Serve cold, in a pint. diff --git a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/fr.txt b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/fr.txt index fc5ed52e4..21f02775e 100644 --- a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/fr.txt +++ b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/fr.txt @@ -11,9 +11,9 @@ 11. Eau distillée ----------------------------------- page 13 12. Bière du Roi ------------------------------------ Page 13 == page 1 =================================================== +vvvvvvvvvvvvvvvvvvvvvvvv Potion de transformation ------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^ 1) Faire bouillir de l'eau dans un chaudron. 2) Ajouter 3 mesures de sisymbre dans le chaudron. 3) Ajouter 2 bottes de polygonum dans le chaudron. @@ -35,11 +35,10 @@ Potion de transformation 18) Ajouter un morceau de la personne voulue. 19) Agiter votre baguette pour terminer la potion. == page 3 =================================================== +vvvvvvvvvvvvvvvvvv Élixir de jeunesse ------------------- - -Attention : **ne pas** boire après 30 ans. - +^^^^^^^^^^^^^^^^^^ +ATTENTION : **ne pas** boire après 30 ans. 1) Remplir un chaudron d'eau de baignoire usagée. 2) Mettre une grenouille de taille moyenne dans l'eau. 3) Laisser la préparation reposer pendant une nuit. @@ -58,53 +57,54 @@ Attention : **ne pas** boire après 30 ans. 15) Assaisonner avec quelques aiguilles de mélèze. 16) Boire la potion directement dans le chaudron. == page 5 =================================================== +vvv/ Ph/ --/ -/ - -\ -/ -\ -/ -\ -7\ -8/ -/ +^/ +/ + +\ +/ +\ +/ +\ +7\ +8/ +/ == page 6 =================================================== +vv\ Mor/ ---/ -_/ -\ -/ -\ -/ - -\ -/ -\ +^^/ +_/ +\ +/ +\ +/ + +\ +/ +\ == page 7 =================================================== +vvvvvvvvvvvvvvvvv Tisane aux herbes ------------------ - +^^^^^^^^^^^^^^^^^ 1) Faire bouillir de l'eau. 2) Ajouter des herbes ramassées en forêt. 3) Laisser infuser cinq minutes, et boire chaud. - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Potion d'invisibilité (instruction en encre invisible) ------------------------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + . ` . - ' + ' == page 8 =================================================== ' . ' ' ` - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Potion de soin homéopathique (partie 1) ---------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Moudre la cause du mal pour obtenir une fine poudre. 2) Ajouter la poudre dans un grand chaudron. 3) Remplir le chaudron d'eau. @@ -122,9 +122,9 @@ Potion de soin homéopathique (partie 1) 15) Vider le chaudron dans les égouts. 16) Remplir le chaudron d'eau. == page 10 ================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Potion de soin homéopathique (partie 2) ---------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Continuer en vidant le chaudron. 2) Remplir le chaudron d'eau. 3) Vider le chaudron dans les égouts. @@ -135,9 +135,9 @@ Potion de soin homéopathique (partie 2) 8) Remplir le chaudron d'eau. 9) Vider le chaudron dans les égouts. == page 11 ================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Potion de soin homéopathique (partie 3) ---------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Vider le chaudron à nouveau (on y est presque). 2) Remplir le chaudron d'eau. 3) Vider le chaudron dans les égouts. @@ -148,9 +148,9 @@ Potion de soin homéopathique (partie 3) 8) Remplir le chaudron d'eau. 9) Verser le contenu du chaudron dans une flasque et boire. == page 12 ================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Ragoût de champignons vénéneux ------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Faire bouillir de l'eau dans un chaudron. 2) Ajouter quelques amanites phalloïdes. 3) Aussi, ajouter quelques amanites tue-mouches. @@ -161,15 +161,14 @@ Ragoût de champignons vénéneux 8) Assaisonner avec une pincée de sel et quelques herbes. 9) Servir chaud, dans une assiette à soupe. == page 13 ================================================== +vvvvvvvvvvvvv Eau distillée -------------- - +^^^^^^^^^^^^^ 1) Faites bouillir de l'eau dans un gros récipient. 2) Laisser la vapeur se condenser dans un récipient propre. 3) Ajouter des minéraux pour améliorer le goût (facultatif). - +vvvvvvvvvvvv Bière du Roi ------------- - +^^^^^^^^^^^^ 1) Aller dans la cave du château et prendre une bouteille. 2) Servir frais, dans une pinte. diff --git a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/it.txt b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/it.txt index 0a537297d..7067c07b9 100644 --- a/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/it.txt +++ b/missions/pipe_intro_book_of_potions/00_shared/book_of_potions/it.txt @@ -11,9 +11,9 @@ 11. Acqua distillata ------------------------------ pagina 13 12. Birra del re ---------------------------------- pagina 13 == pagina 1 ================================================= +vvvvvvvvvvvvvvvvvvvvvvvvv Pozione di trasformazione -------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Bolli acqua in un calderone. 2) Aggiungi 2 unità di erbacce al calderone. 3) Aggiungi 3 gruppetti di correggiola al calderone. @@ -35,11 +35,10 @@ Pozione di trasformazione 18) Aggiungi un pezzo della persona che vorresti diventare. 19) Agita la bacchetta per completare la pozione. == pagina 3 ========================================================== +vvvvvvvvvvvvvvvvvvvv Elisir di giovinezza --------------------- - -Attenzione: **non** bere se si ha più di 30 anni. - +^^^^^^^^^^^^^^^^^^^^ +ATTENZIONE: **non** bere se si ha più di 30 anni. 1) Riempi un calderone con l'acqua del bagno usata. 2) Metti una rana moderatamente grande nell'acqua. 3) Lascia riposare il preparato durante la notte. @@ -58,8 +57,9 @@ Attenzione: **non** bere se si ha più di 30 anni. 15) Aggiungi alcuni aghi di larice per condire. 16) Bevi la pozione dal calderone. == pagina 5 ====================================================== +vvv/ Ph/ --/ +^/ / \ @@ -71,8 +71,9 @@ Ph/ 8/ / == pagina 6 =================================================== +vv\ Bot/ ---/ +^^/ _/ \ / @@ -83,15 +84,16 @@ _/ / \ == pagina 7 =================================================== +vvvvvvvvv Tè d'erbe ---------- - +^^^^^^^^^ 1) Bolli dell'acqua. 2) Aggiungi erbe della foresta. 3) Lascia riposare per cinque minuti e bevi ancora caldo. - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Mantello dell'invisibilità (istruzioni in inchiostro invisibile) - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + . ` . ' == pagina 8 ===================================================== @@ -100,9 +102,9 @@ Mantello dell'invisibilità (istruzioni in inchiostro invisibile) ' ' ` - +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Pozione curativa omeopatica (parte 1) ------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Macina quello che ha causato danni in polvere sottile. 2) Metti la polvere in un grande calderone. 3) Riempi il calderone di acqua. @@ -120,9 +122,9 @@ Pozione curativa omeopatica (parte 1) 15) Svuota il calderone nelle fogne. 16) Riempi d'acqua il calderone. == pagina 10 ==================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Pozione curativa omeopatica (parte 2) ------------------------------------ - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Continua svuotando il calderone. 2) Riempi d'acqua il calderone. 3) Svuota il calderone nelle fogne. @@ -133,9 +135,9 @@ Pozione curativa omeopatica (parte 2) 8) Riempi d'acqua il calderone. 9) Svuota il calderone nelle fogne == pagina 11 ==================================================== +vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv Pozione curativa omeopatica (parte 3) ------------------------------------- - +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 1) Svuota nuovamente il calderone (quasi finito). 2) Riempi d'acqua il calderone. 3) Svuota il calderone nelle fogne. @@ -146,9 +148,9 @@ Pozione curativa omeopatica (parte 3) 8) Riempi d'acqua il calderone. 9) Versa il contenuto del calderone in una fiaschetta e bevi. == pagina 12 ==================================================== +vvvvvvvvvvvvvvvvv Stufato di funghi ------------------ - +^^^^^^^^^^^^^^^^^ 1) Bolli acqua in un calderone. 2) Aggiungi dei funghi mortali (Amanita phalloides). 3) Aggiungi anche degli agarichi di mosca (Amanita muscaria). @@ -159,15 +161,14 @@ Stufato di funghi 8) Condisci con un pizzico di sale e un po' di erbe. 9) Servi caldo in una ciotola. == pagina 13 ============================================================= +vvvvvvvvvvvvvvvv Acqua distillata ----------------- - +^^^^^^^^^^^^^^^^ 1) Bolli acqua in una pentola. 2) Condensa il vapore in un contenitore fresco. 3) Aggiungi minerali per un miglior sapore (facoltativo). - +vvvvvvvvvvvv Birra del re ------------- - +^^^^^^^^^^^^ 1) Vai nella cantina del castello e prendine una bottiglia. 2) Servi freddo, una pinta. diff --git a/missions/pipe_intro_book_of_potions/00_shared/sbin/install_potion_book.sh b/missions/pipe_intro_book_of_potions/00_shared/sbin/install_potion_book.sh index f5e5f8532..d1e943bed 100755 --- a/missions/pipe_intro_book_of_potions/00_shared/sbin/install_potion_book.sh +++ b/missions/pipe_intro_book_of_potions/00_shared/sbin/install_potion_book.sh @@ -39,6 +39,7 @@ install_book() { # NOTE: option --supress-matched doesn't exist in freebsd, nor does the "{*}" repetition + # FIXME: this is rather slow (for loop), maybe an awk script would be faster csplit -ks -f "$BOOK/$(gettext "page")_" "$(eval_gettext '$MISSION_DIR/book_of_potions/en.txt')" "/^==.*/" "{99}" 2>/dev/null for f in "$BOOK/$(gettext "page")_"* do diff --git a/missions/pipe_intro_book_of_potions/05_pipe_head_tail/test.sh b/missions/pipe_intro_book_of_potions/05_pipe_head_tail/test.sh index 5caf94ca5..050cc3dba 100644 --- a/missions/pipe_intro_book_of_potions/05_pipe_head_tail/test.sh +++ b/missions/pipe_intro_book_of_potions/05_pipe_head_tail/test.sh @@ -8,7 +8,7 @@ add_cmd "head -n 6 \"$(gettext "Book_of_potions")/$(gettext 'page')_13\" | tail add_cmd gsh check gsh assert check true -add_cmd "tail -n 9 \"$(gettext "Book_of_potions")/$(gettext "page")_13\" | head -n 3" +add_cmd "tail -n 8 \"$(gettext "Book_of_potions")/$(gettext "page")_13\" | head -n 3" add_cmd gsh check gsh assert check true From 2c670f9086f828323646ed6eeaf7438033690952 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 21 Mar 2025 10:27:22 +0100 Subject: [PATCH 078/103] allow player to use gsh commands in mission 03_cd_HOME_throne it is suprising that cd cd ..... gsh goal gsh check doesn't work because of the gsh goal --- missions/basic/03_cd_HOME_throne/check.sh | 2 +- missions/basic/03_cd_HOME_throne/test.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/missions/basic/03_cd_HOME_throne/check.sh b/missions/basic/03_cd_HOME_throne/check.sh index 4c59892a8..257ac6aa8 100644 --- a/missions/basic/03_cd_HOME_throne/check.sh +++ b/missions/basic/03_cd_HOME_throne/check.sh @@ -6,7 +6,7 @@ _mission_check() { goal=$(readlink-f "$(eval_gettext "\$GSH_HOME/Castle/Main_building/Throne_room")") current=$(readlink-f "$PWD") - ppc=$(. fc-lnr.sh | sed -n '2p;3q') + ppc=$(. fc-lnr.sh | grep -v '^[[:blank:]]*gsh' | sed -n '2p;3q') # FIXME: also accept other commands to go back to the starting point? # FIXME: add an error message diff --git a/missions/basic/03_cd_HOME_throne/test.sh b/missions/basic/03_cd_HOME_throne/test.sh index 53fb633d4..3ea592317 100644 --- a/missions/basic/03_cd_HOME_throne/test.sh +++ b/missions/basic/03_cd_HOME_throne/test.sh @@ -30,6 +30,14 @@ add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd gsh check gsh assert check true +cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" +add_cmd cd +add_cmd gsh goal +add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" +add_cmd gsh goal +add_cmd gsh check +gsh assert check true + alias gc="gsh check" cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd cd From c545ae03f7d552ba626d88d2d52c82aea9fc99c0 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 26 May 2025 15:54:26 +0200 Subject: [PATCH 079/103] check that command doesn't write anything on stderr in stderr_dev-null_grimoires --- .../04_stderr_dev-null_grimoires/check.sh | 23 ++++++++++++------ .../04_stderr_dev-null_grimoires/clean.sh | 6 ++--- .../04_stderr_dev-null_grimoires/init.sh | 6 ++--- .../04_stderr_dev-null_grimoires/test.sh | 24 +++++++++++++++++++ 4 files changed, 46 insertions(+), 13 deletions(-) create mode 100644 missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/test.sh diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/check.sh b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/check.sh index 11fd357d4..b74fec133 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/check.sh +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/check.sh @@ -11,16 +11,25 @@ _mission_check() ( return 1 fi - temp_file=$(mktemp) - eval "$pc" | sort >"$temp_file" - if cmp -s "$GSH_TMP/list_grimoires_GSH" "$temp_file" + temp_file1=$(mktemp) + temp_file2=$(mktemp) + eval "$pc | sort" 1>"$temp_file1" 2>"$temp_file2" + + if ! cmp -s "$GSH_TMP/list_grimoires_GSH" "$temp_file1" + then + rm -f "$temp_file1" "$temp_file2" + return 1 + fi + + if [ -s "$temp_file2" ] then - rm -f "$temp_file" - return 0 - else - rm -f "$temp_file" + echo "$(gettext "Your command shouldn't generate error messages...")" + rm -f "$temp_file1" "$temp_file2" return 1 fi + + rm -f "$temp_file1" "$temp_file2" + return 0 ) _mission_check diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/clean.sh b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/clean.sh index d16d52dbd..8a0e8072d 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/clean.sh +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/clean.sh @@ -1,13 +1,13 @@ #!/usr/bin/env sh -if [ -f "$GSH_TMP/list_grimoires_RO" ] +if [ -f "$GSH_TMP/list_grimoires-R" ] then while IFS= read file do rm "$file" - done < "$GSH_TMP/list_grimoires_RO" + done < "$GSH_TMP/list_grimoires-R" fi unset file -rm -f "$GSH_TMP/list_grimoires_RO" +rm -f "$GSH_TMP/list_grimoires-R" rm -f "$GSH_TMP/list_grimoires_GSH" diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/init.sh b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/init.sh index 705f2cf4a..c9e0bfc60 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/init.sh +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/init.sh @@ -4,7 +4,7 @@ _mission_init() ( #subshell to avoid changing directory bib="$(eval_gettext '$GSH_HOME/Castle/Main_building/Library/Merlin_s_office')" find "$bib" -type f -name "$(gettext "grimoire")_*" -print0 | xargs -0 rm -f - rm -f "$GSH_TMP/list_grimoires_RO" + rm -f "$GSH_TMP/list_grimoires-R" RANDOM 600 | for i in $(seq 100) do @@ -38,8 +38,8 @@ _mission_init() ( #subshell to avoid changing directory read RANDOM if [ $((RANDOM % 2)) -eq 0 ] then - chmod -r "$file" - echo "$file" >> "$GSH_TMP/list_grimoires_RO" + chmod a-r "$file" + echo "$file" >> "$GSH_TMP/list_grimoires-R" fi [ $((i%10)) -eq 0 ] && printf "." done diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/test.sh b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/test.sh new file mode 100644 index 000000000..af67ffca5 --- /dev/null +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/test.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env sh + +. alt_history_start.sh + +cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Library/Merlin_s_office')" + +add_cmd 'grep -i gsh "$(gettext "grimoire")"_*' +add_cmd 'gsh check' +gsh assert check false + +add_cmd 'grep -il gsh "$(gettext "grimoire")"_*' +add_cmd 'gsh check' +gsh assert check false + +chmod a+r "$(gettext "grimoire")"_* +add_cmd 'grep -il gsh "$(gettext "grimoire")"_*' +add_cmd 'gsh check' +gsh assert check false + +add_cmd 'grep -il gsh "$(gettext "grimoire")"_* 2>/dev/null' +add_cmd 'gsh check' +gsh assert check true + +. alt_history_stop.sh From d8e2f9a34f74ced097fb5e95be33682ae794c901 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 26 May 2025 16:08:15 +0200 Subject: [PATCH 080/103] typo (spurious EOL) in goal --- .../05_stdout_stderr_redirection_merlin/goal/fr.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/fr.txt b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/fr.txt index 3028fba76..b2cb230bf 100644 --- a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/fr.txt +++ b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/goal/fr.txt @@ -6,8 +6,7 @@ l'observatoire et tient des propos incohérents, voire incompréhensibles. Vous devez filtrer son charabia afin de trouver la clé secrète qu'il -est le -seul à connaitre. +est le seul à connaitre. Indice ------ From 9aae3c413770d52926a5fad25d90f40e7b278d35 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 17 Mar 2025 17:25:32 +0100 Subject: [PATCH 081/103] added tests-lang target to Makefile to run tests in English, French and Italian --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 2296c78a9..03e85c887 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,13 @@ tests-zsh: clean ./utils/archive.sh -at -N "game shell (1)" ./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' +## run all the test.sh and auto.sh scripts +tests-lang: clean + ./utils/gameshell_archive.sh -at -N "game shell (1)" + ./"game shell (1).sh" -L en -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -L fr -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -L it -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + clean: rm -rf i18n/*~ locale gameshell gameshell.tar gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk rm -rf .bin .config .sbin .tmp .save World From 0063b3cddefabc8d908354d20324dd510996da16 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 17 Jun 2025 16:53:45 +0200 Subject: [PATCH 082/103] updated release workflows --- ...st_game_archive.yml => latest_release.yml} | 21 ++++++++++++++----- .github/workflows/tag_release.yml | 14 +++++++++---- 2 files changed, 26 insertions(+), 9 deletions(-) rename .github/workflows/{latest_game_archive.yml => latest_release.yml} (51%) diff --git a/.github/workflows/latest_game_archive.yml b/.github/workflows/latest_release.yml similarity index 51% rename from .github/workflows/latest_game_archive.yml rename to .github/workflows/latest_release.yml index 3205b5650..dc72286f5 100644 --- a/.github/workflows/latest_game_archive.yml +++ b/.github/workflows/latest_release.yml @@ -22,15 +22,26 @@ jobs: - name: "Creating the archive" run: | - git fetch --tags --force && ./utils/archive.sh + git fetch --tags --force + ./utils/archive.sh - - uses: "marvinpinto/action-automatic-releases@latest" + - name: "Create or move 'latest' tag" + run: | + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git tag -f latest + git push origin latest --force + + - name: "Create GitHub Release" + uses: softprops/action-gh-release@v2 with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" - automatic_release_tag: "latest" + tag_name: latest + name: "Latest game archive" prerelease: true - title: "Latest game archive" files: | LICENSE gameshell.sh Dockerfile + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index 4aafb47ef..4636f28d4 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -3,11 +3,12 @@ name: "Tagged release" on: push: tags: - - "v*" + - "v*" # Trigger only on version tags jobs: pre-release: runs-on: "ubuntu-latest" + steps: - name: "Checkout source code" uses: "actions/checkout@v4" @@ -20,13 +21,18 @@ jobs: - name: "Creating the archive" run: | - git fetch --tags --force && ./utils/archive.sh + git fetch --tags --force + ./utils/archive.sh - - uses: "marvinpinto/action-automatic-releases@latest" + - name: "Create GitHub Release" + uses: softprops/action-gh-release@v2 with: - repo_token: "${{ secrets.GITHUB_TOKEN }}" + name: "Release ${{ github.ref_name }}" prerelease: false files: | LICENSE gameshell.sh Dockerfile + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + From 255a37d96c365204071e46231590de4510dedd50 Mon Sep 17 00:00:00 2001 From: Rodolphe Lepigre Date: Sun, 28 Dec 2025 08:31:10 +0100 Subject: [PATCH 083/103] Fix typo (anwser -> answer) everywhere. Co-authored-by: Chuck Jaeger --- .../02_stdin_redirection_multiplications/i18n/en.po | 4 ++-- .../02_stdin_redirection_multiplications/i18n/fr.po | 2 +- .../02_stdin_redirection_multiplications/i18n/it.po | 2 +- .../02_stdin_redirection_multiplications/i18n/template.pot | 2 +- .../02_stdin_redirection_multiplications/init.sh | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/en.po b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/en.po index a7d1165c9..5420c82ab 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/en.po +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/en.po @@ -31,9 +31,9 @@ msgstr "Mathematics_101" msgid "That's not even a number!" msgstr "That's not even a number!" -msgid "The book 'Mathematics_101' contains all the anwsers.\n" +msgid "The book 'Mathematics_101' contains all the answers.\n" "Just copy all its lines to get perfect score." -msgstr "The book 'Mathematics_101' contains all the anwsers.\n" +msgstr "The book 'Mathematics_101' contains all the answers.\n" "Just copy all its lines to get perfect score." #, sh-format diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/fr.po b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/fr.po index 4165694d2..646a5996d 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/fr.po +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/fr.po @@ -30,7 +30,7 @@ msgstr "Mathematiques_en_premiere_annee" msgid "That's not even a number!" msgstr "Ce n'est même pas un nombre !" -msgid "The book 'Mathematics_101' contains all the anwsers.\n" +msgid "The book 'Mathematics_101' contains all the answers.\n" "Just copy all its lines to get perfect score." msgstr "Le livre 'Mathematiques_en_premiere_annee' contient les réponses.\n" "Recopie simplement toutes ses lignes pour avoir la note maximale." diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po index f51880c47..7288636f1 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/it.po @@ -30,7 +30,7 @@ msgstr "Matematica_101" msgid "That's not even a number!" msgstr "Non è nemmeno un numero!" -msgid "The book 'Mathematics_101' contains all the anwsers.\n" +msgid "The book 'Mathematics_101' contains all the answers.\n" "Just copy all its lines to get perfect score." msgstr "Il libro 'Matematica_101' contiene tutte le risposte.\n" "Copia tutte le sue righe per avere il massimo punteggio." diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/template.pot b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/template.pot index d8a3e90b0..ca3467ff9 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/template.pot +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/i18n/template.pot @@ -30,7 +30,7 @@ msgstr "" msgid "That's not even a number!" msgstr "" -msgid "The book 'Mathematics_101' contains all the anwsers.\n" +msgid "The book 'Mathematics_101' contains all the answers.\n" "Just copy all its lines to get perfect score." msgstr "" diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/init.sh b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/init.sh index 1dfcaff4f..11cf4fc6a 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/init.sh +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/init.sh @@ -10,7 +10,7 @@ cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. EOB -echo "$(gettext "The book 'Mathematics_101' contains all the anwsers. +echo "$(gettext "The book 'Mathematics_101' contains all the answers. Just copy all its lines to get perfect score.")" \ > "$(eval_gettext '$GSH_HOME/Castle/Main_building/Library')/.$(gettext "How_to_cheat_for_exams")" From a154ac366558a6d2586be4913de713a47a85dab2 Mon Sep 17 00:00:00 2001 From: Chuck Jaeger Date: Fri, 28 Nov 2025 21:45:49 -0500 Subject: [PATCH 084/103] Update en.txt typo fix: optionnal -> optional --- missions/intermediate/04_bg_xeyes/skip/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/intermediate/04_bg_xeyes/skip/en.txt b/missions/intermediate/04_bg_xeyes/skip/en.txt index 8f8cf2583..ffcdd7f7a 100644 --- a/missions/intermediate/04_bg_xeyes/skip/en.txt +++ b/missions/intermediate/04_bg_xeyes/skip/en.txt @@ -1,4 +1,4 @@ -This mission is optionnal. You can skip it and go to the next one with the +This mission is optional. You can skip it and go to the next one with the command $ gsh skip From e26082d6c3be0e2e2cd0b50f885640bdc4efdffd Mon Sep 17 00:00:00 2001 From: Chuck Jaeger Date: Fri, 28 Nov 2025 21:43:40 -0500 Subject: [PATCH 085/103] Update en.txt typo fix: optionnal -> optional --- missions/misc/01_cal_nostradamus/skip/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/misc/01_cal_nostradamus/skip/en.txt b/missions/misc/01_cal_nostradamus/skip/en.txt index 8f8cf2583..ffcdd7f7a 100644 --- a/missions/misc/01_cal_nostradamus/skip/en.txt +++ b/missions/misc/01_cal_nostradamus/skip/en.txt @@ -1,4 +1,4 @@ -This mission is optionnal. You can skip it and go to the next one with the +This mission is optional. You can skip it and go to the next one with the command $ gsh skip From 5c81a004848689bbbfb50a2d1ab368b9cfe1fdaa Mon Sep 17 00:00:00 2001 From: Eric Riese <4515131+er2@users.noreply.github.com> Date: Sat, 23 Nov 2024 20:00:38 -0500 Subject: [PATCH 086/103] Support Dev Containers add GitHub Codespaces. Co-authored-by: Rodolphe Lepigre --- .devcontainer/devcontainer.json | 11 +++++++++++ Dockerfile | 1 + README-fr.md | 24 ++++++++++++++++++++++++ README.md | 22 ++++++++++++++++++++++ 4 files changed, 58 insertions(+) create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 000000000..5a430c927 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,11 @@ +// Support for the Visual Studio Code Dev Containers extension. +// For format details, see https://aka.ms/devcontainer.json. +{ + "name": "GameShell Dev Container", + "build": { + // Sets the run context to be the repository root. + "context": "..", + // Sets the filename for the "Dockerfile". + "dockerfile": "../Dockerfile" + } +} diff --git a/Dockerfile b/Dockerfile index e5d575f74..34d794cc7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,6 +20,7 @@ RUN rm -rf /var/lib/apt/lists/* # install locales and set default RUN sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen RUN sed -i 's/^# *\(fr_FR.UTF-8\)/\1/' /etc/locale.gen +RUN sed -i 's/^# *\(it_IT.UTF-8\)/\1/' /etc/locale.gen RUN locale-gen RUN update-locale LANG=en_US.UTF-8 ENV LANG en_US.UTF-8 diff --git a/README-fr.md b/README-fr.md index daee626d1..92daf21bb 100644 --- a/README-fr.md +++ b/README-fr.md @@ -72,6 +72,30 @@ programmes X depuis GameShell. Référez vous à [cette section](./doc/deps.md#running-GameShell-from-a-docker-container) du manuel d'utilisateur. +Github Codespaces (ou VSCode) +----------------------------- + +[![Ouvrir dans un Codespace](https://github.com/codespaces/badge.svg)](https://codespaces.new/phyver/GameShell) + +Ce dépôt est configuré pour fonctionner avec l'extension +[Dev Container](https://containers.dev/) de Visual Studio Code, ce qui permet +d'utiliser GameShell depuis un +[Codespace Github](https://github.com/features/codespaces). + +Dés que le Codespace est lancé (en cliquant sur le badge ci-dessus), utilisez +la commande suivante dans le terminal pour démarrer le jeu. +```sh +bash start.sh -L fr +``` +Une langue alternative peut être sélectionnée avec l'option `-L`. Par exemple, +la command suivante lance le jeu en italien. +```sh +bash start.sh -L it +``` + +Pour une expérience similaire sur votre machine, sans les limitations / coûts +d'un Codespace, voire la [doc de l'extension Dev Container](https://containers.dev/supporting#tools). + Documentation ------------- diff --git a/README.md b/README.md index 1fd3988ac..234f2ffeb 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,28 @@ you want to run X programs from inside GameShell. Refer to [this section](./doc/deps.md#running-GameShell-from-a-docker-container) of the user manual. +Github Codespaces (or VSCode) +----------------------------- + +[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/phyver/GameShell) + +This repository is configured to work with the Visual Studio Code +[Dev Container](https://containers.dev/) extension, which enables GameShell to +be run from a [Github Codespace](https://github.com/features/codespaces). + +Once the Codespace is launched (via the above badge), you can run GameShell in +the terminal with the following command. +```sh +bash start.sh +``` +An alternative language can be selected using the `-L` option. For example, +the following command will start the game in Italian. +```sh +bash start.sh -L it +``` + +To get the same experience on your local machine without the limitations/cost +of Codespaces see the [Dev Container docs](https://containers.dev/supporting#tools). Documentation ------------- From 293d1a5a3ab84b0e2b09322b7fa977e27b1ce119 Mon Sep 17 00:00:00 2001 From: Manuel Zavatta Date: Wed, 16 Jul 2025 10:58:58 +0200 Subject: [PATCH 087/103] fix italian typos --- missions/finding_files_maze/05_find_xargs_grep/i18n/it.po | 2 +- missions/misc/03_tr_caesar_shift/goal/it.txt | 4 ++-- .../03_stdout_redirection_inventory/goal/it.txt | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/missions/finding_files_maze/05_find_xargs_grep/i18n/it.po b/missions/finding_files_maze/05_find_xargs_grep/i18n/it.po index 4e941e234..00409c8a2 100644 --- a/missions/finding_files_maze/05_find_xargs_grep/i18n/it.po +++ b/missions/finding_files_maze/05_find_xargs_grep/i18n/it.po @@ -57,7 +57,7 @@ msgid "There is no diamond in your chest." msgstr "Non ci sono diamanti nella cassa!" msgid "diamond" -msgstr "diamonte" +msgstr "diamante" msgid "stone" msgstr "pietra" diff --git a/missions/misc/03_tr_caesar_shift/goal/it.txt b/missions/misc/03_tr_caesar_shift/goal/it.txt index 0a9e9735b..158a61c96 100644 --- a/missions/misc/03_tr_caesar_shift/goal/it.txt +++ b/missions/misc/03_tr_caesar_shift/goal/it.txt @@ -10,8 +10,8 @@ Decriptalo facendo una ricerca completa dalla linea di comando. Suggerimento ---- -Tutti i messaggi segreti sono stati trovati con uno spostamento -di 10 e 16 caratteri. +Tutti gli altri messaggi segreti rinvenuti utilizzavano uno +scostamento compreso tra 10 e 16 caratteri. Comandi utili diff --git a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/goal/it.txt b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/goal/it.txt index 59e9e1951..6be9d3348 100644 --- a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/goal/it.txt +++ b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/goal/it.txt @@ -1,7 +1,7 @@ Obiettivi Missione ============ -I vecchi libri di magia di Merlino sono conservato nella libreria nel suo ufficio. +I vecchi libri di magia di Merlino sono conservati nella libreria nel suo ufficio. Devi salvare una lista di tutti i libri di magia (e nient'altro) in un file chiamato "inventario.txt", nel cassetto... From 912df824673d36152455929c66f19a580338a570 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Sat, 28 Feb 2026 17:40:00 +0100 Subject: [PATCH 088/103] better wording for mission 19 as suggested by jbtls in https://github.com/phyver/GameShell/issues/181 --- missions/intermediate/05_background/goal/en.txt | 2 +- missions/intermediate/05_background/goal/fr.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt index cdb9837c6..0ddc87418 100644 --- a/missions/intermediate/05_background/goal/en.txt +++ b/missions/intermediate/05_background/goal/en.txt @@ -2,7 +2,7 @@ Mission goal ============ The king's pyrotechnician appears next to you. He asks you to fire **at least -3 consecutive fireworks** so he can see them from far away. +3 simultaneous fireworks** so he can see them from far away. A single firework can be created with the magical word diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt index 1af5535fe..815bd95bb 100644 --- a/missions/intermediate/05_background/goal/fr.txt +++ b/missions/intermediate/05_background/goal/fr.txt @@ -2,7 +2,7 @@ Objectif ========= L'artificier royal apparait à vos cotés. Il vous demande de tirer **au moins 3 -jeux d'artifices consécutifs** pour qu'il puisse les voir de loin. +jeux d'artifices simultanés** pour qu'il puisse les voir de loin. Une fusée simple peut être lancée avec le mot magique From 8664cec8eeb0cdc8e4bc1409f55d8084d5c31914 Mon Sep 17 00:00:00 2001 From: Florent Bouchez Tichadou Date: Fri, 24 Jan 2025 16:41:56 +0100 Subject: [PATCH 089/103] Fix typo in doc --- doc/mission.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/mission.md b/doc/mission.md index 9f6ec8abe..f2079f9a8 100644 --- a/doc/mission.md +++ b/doc/mission.md @@ -201,7 +201,7 @@ Useful commands =============== cd PLACE - Move to the given place, if accessible from you current location. + Move to the given place, if accessible from your current location. ``` For uniformity, meta-variables in commands should be in UPPERCASE. From 4e38824d7b3fcc30878bb4b13ab39748b533c84f Mon Sep 17 00:00:00 2001 From: Florent Bouchez Tichadou Date: Fri, 24 Jan 2025 17:51:37 +0100 Subject: [PATCH 090/103] accepts "cd ~" for mission 3 and move back to cellar on init --- missions/basic/03_cd_HOME_throne/check.sh | 24 +++++++- missions/basic/03_cd_HOME_throne/goal/en.txt | 2 +- missions/basic/03_cd_HOME_throne/goal/fr.txt | 2 +- missions/basic/03_cd_HOME_throne/i18n/en.po | 18 +++++- missions/basic/03_cd_HOME_throne/i18n/fr.po | 16 ++++++ missions/basic/03_cd_HOME_throne/i18n/it.po | 57 ++++++++++++------- .../basic/03_cd_HOME_throne/i18n/template.pot | 16 ++++++ missions/basic/03_cd_HOME_throne/init.sh | 14 +++++ missions/basic/03_cd_HOME_throne/static.sh | 1 + missions/basic/03_cd_HOME_throne/test.sh | 28 +++++---- 10 files changed, 141 insertions(+), 37 deletions(-) create mode 100644 missions/basic/03_cd_HOME_throne/init.sh diff --git a/missions/basic/03_cd_HOME_throne/check.sh b/missions/basic/03_cd_HOME_throne/check.sh index 257ac6aa8..34f8d0b77 100644 --- a/missions/basic/03_cd_HOME_throne/check.sh +++ b/missions/basic/03_cd_HOME_throne/check.sh @@ -6,11 +6,29 @@ _mission_check() { goal=$(readlink-f "$(eval_gettext "\$GSH_HOME/Castle/Main_building/Throne_room")") current=$(readlink-f "$PWD") + + # Verify the current location + if [ "$goal" != "$current" ]; then + echo "$(gettext "You are not in the throne room.")" + return 1 + fi + + ppc=$(. fc-lnr.sh | grep -v '^[[:blank:]]*gsh' | sed -n '2p;3q') - # FIXME: also accept other commands to go back to the starting point? - # FIXME: add an error message - [ "$goal" = "$current" ] && [ "$ppc" = "cd" ] + if echo "$ppc" | grep -q "^[[:blank:]]*\(cd\|cd[[:blank:]][[:blank:]]*\~\)[[:blank:]]*$"; then + # Accepts only "cd" and "cd ~" + return 0 + fi + + # "cd ../../../../" and variants are not valid. + if echo "$ppc" | grep -q "^[[:blank:]]*cd[[:blank:]][[:blank:]]*\.\..*$"; then + echo "$(gettext "The previous to last command is too complex.")" + else + echo "$(gettext "The previous to last command must take you to the starting point.")" + fi + + return 1 } _mission_check diff --git a/missions/basic/03_cd_HOME_throne/goal/en.txt b/missions/basic/03_cd_HOME_throne/goal/en.txt index 8ac6430d9..c81f27a41 100644 --- a/missions/basic/03_cd_HOME_throne/goal/en.txt +++ b/missions/basic/03_cd_HOME_throne/goal/en.txt @@ -17,7 +17,7 @@ Useful commands =============== cd - Move back to the starting location. + Move back to GameShell's starting location. cd LOCATION1/LOCATION2/LOCATION3 Make several moves in one command. diff --git a/missions/basic/03_cd_HOME_throne/goal/fr.txt b/missions/basic/03_cd_HOME_throne/goal/fr.txt index a58eaba73..aaeb273b2 100644 --- a/missions/basic/03_cd_HOME_throne/goal/fr.txt +++ b/missions/basic/03_cd_HOME_throne/goal/fr.txt @@ -19,7 +19,7 @@ Commandes utiles ================ cd - Revient au lieu initial. + Revient au lieu de départ de GameShell. cd LIEU1/LIEU2/LIEU3 Fait plusieurs déplacements avec une commande. diff --git a/missions/basic/03_cd_HOME_throne/i18n/en.po b/missions/basic/03_cd_HOME_throne/i18n/en.po index 9357b4a6d..4fd94053f 100644 --- a/missions/basic/03_cd_HOME_throne/i18n/en.po +++ b/missions/basic/03_cd_HOME_throne/i18n/en.po @@ -1,12 +1,15 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" +msgstr "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" #, sh-format msgid "$GSH_HOME/Castle/Main_building/Throne_room" msgstr "$GSH_HOME/Castle/Main_building/Throne_room" +msgid "$GSH_HOME/Castle/Cellar" +msgstr "$GSH_HOME/Castle/Cellar" + # path for the text file containing the goal msgid "$MISSION_DIR/goal/en.txt" msgstr "$MISSION_DIR/goal/en.txt" @@ -18,3 +21,16 @@ msgstr "$MISSION_DIR/skip/en.txt" # path for the text file containing the treasure message msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/en.txt" + +msgid "The previous to last command is too complex." +msgstr "The previous to last command is too complex." + +msgid "The previous to last command must take you to the starting point." +msgstr "The previous to last command must take you to the starting point." + +msgid "You are not in the throne room." +msgstr "You are not in the throne room." + +#, sh-format +msgid "You have been teleported to" +msgstr "You have been teleported to" diff --git a/missions/basic/03_cd_HOME_throne/i18n/fr.po b/missions/basic/03_cd_HOME_throne/i18n/fr.po index 147834490..395f8954b 100644 --- a/missions/basic/03_cd_HOME_throne/i18n/fr.po +++ b/missions/basic/03_cd_HOME_throne/i18n/fr.po @@ -6,6 +6,9 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n" msgid "$GSH_HOME/Castle/Main_building/Throne_room" msgstr "$GSH_HOME/Chateau/Batiment_principal/Salle_du_trone" +msgid "$GSH_HOME/Castle/Cellar" +msgstr "$GSH_HOME/Chateau/Cave" + # path for the text file containing the goal msgid "$MISSION_DIR/goal/en.txt" msgstr "$MISSION_DIR/goal/fr.txt" @@ -17,3 +20,16 @@ msgstr "$MISSION_DIR/skip/fr.txt" # path for the text file containing the treasure message msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "$MISSION_DIR/treasure-msg/fr.txt" + +msgid "The previous to last command is too complex." +msgstr "L'avant-dernière commande est trop complexe." + +msgid "The previous to last command must take you to the starting point." +msgstr "L'avant-dernière commande doit vous ramener au point de départ." + +msgid "You are not in the throne room." +msgstr "Vous n'êtes pas dans la salle du trône." + +#, sh-format +msgid "You have been teleported to" +msgstr "Vous avez été téléporté à" diff --git a/missions/basic/03_cd_HOME_throne/i18n/it.po b/missions/basic/03_cd_HOME_throne/i18n/it.po index 6b117ef1c..37e429137 100644 --- a/missions/basic/03_cd_HOME_throne/i18n/it.po +++ b/missions/basic/03_cd_HOME_throne/i18n/it.po @@ -1,30 +1,45 @@ # mte90 , 2022. -msgid "" -msgstr "" -"Project-Id-Version: \n" -"POT-Creation-Date: \n" -"PO-Revision-Date: 2022-07-11 14:15+0200\n" -"Last-Translator: mte90 \n" -"Language-Team: Italian \n" -"Language: it\n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"X-Generator: Lokalize 22.04.1\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +msgid "" +msgstr "Project-Id-Version: \n" + "POT-Creation-Date: \n" + "PO-Revision-Date: 2022-07-11 14:15+0200\n" + "Last-Translator: mte90 \n" + "Language-Team: Italian \n" + "Language: it\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "X-Generator: Lokalize 22.04.1\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" #, sh-format -msgid "$GSH_HOME/Castle/Main_building/Throne_room" -msgstr "$GSH_HOME/Castello/Palazzo_principale/Sala_del_trono" +msgid "$GSH_HOME/Castle/Main_building/Throne_room" +msgstr "$GSH_HOME/Castello/Palazzo_principale/Sala_del_trono" + +msgid "$GSH_HOME/Castle/Cellar" +msgstr "$GSH_HOME/Castello/Cantina" # path for the text file containing the goal -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "$MISSION_DIR/skip/it.txt" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/it.txt" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "$MISSION_DIR/treasure-msg/it.txt" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/it.txt" + +msgid "The previous to last command is too complex." +msgstr "" + +msgid "The previous to last command must take you to the starting point." +msgstr "" + +msgid "You are not in the throne room." +msgstr "" + +#, sh-format +msgid "You have been teleported to" +msgstr "" diff --git a/missions/basic/03_cd_HOME_throne/i18n/template.pot b/missions/basic/03_cd_HOME_throne/i18n/template.pot index 02912d7e3..ac0cccf25 100644 --- a/missions/basic/03_cd_HOME_throne/i18n/template.pot +++ b/missions/basic/03_cd_HOME_throne/i18n/template.pot @@ -6,6 +6,9 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n" msgid "$GSH_HOME/Castle/Main_building/Throne_room" msgstr "" +msgid "$GSH_HOME/Castle/Cellar" +msgstr "" + # path for the text file containing the goal msgid "$MISSION_DIR/goal/en.txt" msgstr "" @@ -17,3 +20,16 @@ msgstr "" # path for the text file containing the treasure message msgid "$MISSION_DIR/treasure-msg/en.txt" msgstr "" + +msgid "The previous to last command is too complex." +msgstr "" + +msgid "The previous to last command must take you to the starting point." +msgstr "" + +msgid "You are not in the throne room." +msgstr "" + +#, sh-format +msgid "You have been teleported to" +msgstr "" diff --git a/missions/basic/03_cd_HOME_throne/init.sh b/missions/basic/03_cd_HOME_throne/init.sh new file mode 100644 index 000000000..10c927845 --- /dev/null +++ b/missions/basic/03_cd_HOME_throne/init.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env sh + +current=$(pwd -P) +expected=$(cd "$(eval_gettext '$GSH_HOME/Castle/Cellar')"; pwd -P) + +if [ "$current" != "$expected" ] +then + cd "$expected" + expected=${expected#$GSH_ROOT} + expected=${expected#/} + echo "$(eval_gettext "You have been teleported to") .../$expected" +fi + +unset current expected diff --git a/missions/basic/03_cd_HOME_throne/static.sh b/missions/basic/03_cd_HOME_throne/static.sh index 44cd0b87c..78fd4deaf 100644 --- a/missions/basic/03_cd_HOME_throne/static.sh +++ b/missions/basic/03_cd_HOME_throne/static.sh @@ -1,3 +1,4 @@ #!/usr/bin/env sh +mkdir -p "$(eval_gettext '$GSH_HOME/Castle/Cellar')" mkdir -p "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" diff --git a/missions/basic/03_cd_HOME_throne/test.sh b/missions/basic/03_cd_HOME_throne/test.sh index 3ea592317..ff0ac13ea 100644 --- a/missions/basic/03_cd_HOME_throne/test.sh +++ b/missions/basic/03_cd_HOME_throne/test.sh @@ -7,29 +7,35 @@ add_cmd dummy1 add_cmd dummy2 add_cmd dummy3 -cd -add_cmd gsh check -gsh assert check false - +# OK +cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd cd add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" -cd add_cmd gsh check -gsh assert check false +gsh assert check true +# OK +cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" +add_cmd cd \~ add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" -add_cmd cd ../../../ +add_cmd gsh check +gsh assert check true + +# not OK, using cd ../.. shouldn't work +cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" +add_cmd cd ../.. add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" -cd add_cmd gsh check gsh assert check false -cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" +# commands OK, but not in appropriate directory +cd add_cmd cd add_cmd cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd gsh check -gsh assert check true +gsh assert check false +# OK, with several gsh commands in between actual commands cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd cd add_cmd gsh goal @@ -38,6 +44,7 @@ add_cmd gsh goal add_cmd gsh check gsh assert check true +# OK, with aliases for gsh commands alias gc="gsh check" cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" add_cmd cd @@ -46,6 +53,7 @@ add_cmd gc gsh assert check true unalias gc +# OK, with nested aliases for gsh commands alias check="gsh check" alias gc=check cd "$(eval_gettext '$GSH_HOME/Castle/Main_building/Throne_room')" From a0d86b75fafd4fc86e886b07314f4f4955d8654f Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Tue, 19 Nov 2024 15:51:08 +0100 Subject: [PATCH 091/103] testing asciidoc to generate a manpage, the help and HELP commands the utils/archive.sh script has been renamed to utils/gameshell_archive.sh NOTE for translators The files are located in $GSH_ROOT/i18n/source/gsh-commands/LANG - commands_admin.txt - commands_dev.txt - commands_misc.txt - commands_standard.txt contain the help for gsh commands. (Note that trailing "+" symbols are there to indicate hard line breaks and should be kept.) - gsh_help.txt is the header used with commands_standard.txt to generate the output of the "gsh help" command. - gsh_full_help.txt is used to wrap the commands_*.txt files to generate the output of the "gsh HELP" command. - man_gsh.txt It is used to generate the manpage (with asciidoc) with the commands_*.txt files. It contains additional comments / explanations about GameShell. If you do translate it, don't forget to add your name somewhere! You can generate each of the output files with $ make LANG.1 $ make LANG.help The command $ make install should install the files in the appropriates directories. --- .github/workflows/latest_release.yml | 2 +- .github/workflows/tag_release.yml | 2 +- Dockerfile | 2 +- Makefile | 22 +- README-it.md | 2 +- doc/faq.md | 2 +- doc/gameshell.md | 8 +- doc/misc.md | 4 +- i18n/en.po | 16 +- i18n/fr.po | 18 +- i18n/gameshell-help/fr.txt | 21 -- i18n/gsh-full-help/README | 2 + .../en.txt | 108 ++++--- .../fr.txt | 101 ++++--- .../it.txt | 2 +- i18n/gsh-help/README | 2 + i18n/{gameshell-help => gsh-help}/en.txt | 9 +- i18n/gsh-help/fr.txt | 19 ++ i18n/{gameshell-help => gsh-help}/it.txt | 11 +- i18n/it.po | 20 +- i18n/source/clean.sed | 16 ++ i18n/source/gsh-commands/Makefile | 44 +++ i18n/source/gsh-commands/en.1 | 268 ++++++++++++++++++ i18n/source/gsh-commands/en.full_help | 103 +++++++ i18n/source/gsh-commands/en.help | 20 ++ i18n/source/gsh-commands/en.txt | 174 ++++++++++++ .../source/gsh-commands/en/commands_admin.txt | 11 + i18n/source/gsh-commands/en/commands_dev.txt | 38 +++ i18n/source/gsh-commands/en/commands_misc.txt | 11 + .../gsh-commands/en/commands_standard.txt | 17 ++ i18n/source/gsh-commands/en/gsh_full_help.txt | 30 ++ i18n/source/gsh-commands/en/gsh_help.txt | 4 + i18n/source/gsh-commands/en/man_gsh.txt | 101 +++++++ i18n/source/gsh-commands/fr.1 | 267 +++++++++++++++++ i18n/source/gsh-commands/fr.full_help | 105 +++++++ i18n/source/gsh-commands/fr.help | 19 ++ .../source/gsh-commands/fr/commands_admin.txt | 13 + i18n/source/gsh-commands/fr/commands_dev.txt | 39 +++ i18n/source/gsh-commands/fr/commands_misc.txt | 11 + .../gsh-commands/fr/commands_standard.txt | 16 ++ i18n/source/gsh-commands/fr/gsh_full_help.txt | 30 ++ i18n/source/gsh-commands/fr/gsh_help.txt | 4 + i18n/source/gsh-commands/fr/man_gsh.txt | 106 +++++++ .../source/gsh-commands/it/commands_admin.txt | 11 + i18n/source/gsh-commands/it/commands_dev.txt | 38 +++ i18n/source/gsh-commands/it/commands_misc.txt | 11 + .../gsh-commands/it/commands_standard.txt | 17 ++ i18n/source/gsh-commands/it/gsh_full_help.txt | 30 ++ i18n/source/gsh-commands/it/gsh_help.txt | 4 + i18n/source/gsh-commands/it/man_gsh.txt | 101 +++++++ i18n/source/include_files.awk | 16 ++ i18n/template.pot | 8 +- lib/gsh.sh | 4 +- lib/header.sh | 2 +- man/README | 2 + man/fr/man1/gsh.1 | 267 +++++++++++++++++ man/man1/gsh.1 | 268 ++++++++++++++++++ missions/default.idx | 2 +- scripts/_gsh_version | 4 +- scripts/progress_bar | 2 +- start.sh | 2 +- utils/{archive.sh => gameshell_archive.sh} | 24 +- 62 files changed, 2452 insertions(+), 181 deletions(-) delete mode 100644 i18n/gameshell-help/fr.txt create mode 100644 i18n/gsh-full-help/README rename i18n/{gameshell-full-help => gsh-full-help}/en.txt (68%) rename i18n/{gameshell-full-help => gsh-full-help}/fr.txt (75%) rename i18n/{gameshell-full-help => gsh-full-help}/it.txt (98%) create mode 100644 i18n/gsh-help/README rename i18n/{gameshell-help => gsh-help}/en.txt (59%) create mode 100644 i18n/gsh-help/fr.txt rename i18n/{gameshell-help => gsh-help}/it.txt (53%) create mode 100755 i18n/source/clean.sed create mode 100644 i18n/source/gsh-commands/Makefile create mode 100644 i18n/source/gsh-commands/en.1 create mode 100644 i18n/source/gsh-commands/en.full_help create mode 100644 i18n/source/gsh-commands/en.help create mode 100644 i18n/source/gsh-commands/en.txt create mode 100644 i18n/source/gsh-commands/en/commands_admin.txt create mode 100644 i18n/source/gsh-commands/en/commands_dev.txt create mode 100644 i18n/source/gsh-commands/en/commands_misc.txt create mode 100644 i18n/source/gsh-commands/en/commands_standard.txt create mode 100644 i18n/source/gsh-commands/en/gsh_full_help.txt create mode 100644 i18n/source/gsh-commands/en/gsh_help.txt create mode 100644 i18n/source/gsh-commands/en/man_gsh.txt create mode 100644 i18n/source/gsh-commands/fr.1 create mode 100644 i18n/source/gsh-commands/fr.full_help create mode 100644 i18n/source/gsh-commands/fr.help create mode 100644 i18n/source/gsh-commands/fr/commands_admin.txt create mode 100644 i18n/source/gsh-commands/fr/commands_dev.txt create mode 100644 i18n/source/gsh-commands/fr/commands_misc.txt create mode 100644 i18n/source/gsh-commands/fr/commands_standard.txt create mode 100644 i18n/source/gsh-commands/fr/gsh_full_help.txt create mode 100644 i18n/source/gsh-commands/fr/gsh_help.txt create mode 100644 i18n/source/gsh-commands/fr/man_gsh.txt create mode 100644 i18n/source/gsh-commands/it/commands_admin.txt create mode 100644 i18n/source/gsh-commands/it/commands_dev.txt create mode 100644 i18n/source/gsh-commands/it/commands_misc.txt create mode 100644 i18n/source/gsh-commands/it/commands_standard.txt create mode 100644 i18n/source/gsh-commands/it/gsh_full_help.txt create mode 100644 i18n/source/gsh-commands/it/gsh_help.txt create mode 100644 i18n/source/gsh-commands/it/man_gsh.txt create mode 100755 i18n/source/include_files.awk create mode 100644 man/README create mode 100644 man/fr/man1/gsh.1 create mode 100644 man/man1/gsh.1 rename utils/{archive.sh => gameshell_archive.sh} (93%) diff --git a/.github/workflows/latest_release.yml b/.github/workflows/latest_release.yml index dc72286f5..3c505ffee 100644 --- a/.github/workflows/latest_release.yml +++ b/.github/workflows/latest_release.yml @@ -23,7 +23,7 @@ jobs: - name: "Creating the archive" run: | git fetch --tags --force - ./utils/archive.sh + ./utils/gameshell_archive.sh - name: "Create or move 'latest' tag" run: | diff --git a/.github/workflows/tag_release.yml b/.github/workflows/tag_release.yml index 4636f28d4..0b4d77fa9 100644 --- a/.github/workflows/tag_release.yml +++ b/.github/workflows/tag_release.yml @@ -22,7 +22,7 @@ jobs: - name: "Creating the archive" run: | git fetch --tags --force - ./utils/archive.sh + ./utils/gameshell_archive.sh - name: "Create GitHub Release" uses: softprops/action-gh-release@v2 diff --git a/Dockerfile b/Dockerfile index 34d794cc7..15a0471bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -46,7 +46,7 @@ ADD --chown=gsh-user:gsh-user https://github.com/phyver/GameShell/releases/downl ### if you prefer to use a local customized version, comment the preceeding ### ADD ... ### line and uncomment the next one -### (NOTE that you need to have generated a "gameshell.sh" file with GSH_ROOT/utils/archive.sh +### (NOTE that you need to have generated a "gameshell.sh" file with GSH_ROOT/utils/gameshell_archive.sh # COPY gameshell.sh . ENTRYPOINT ["bash", "./gameshell.sh"] diff --git a/Makefile b/Makefile index 03e85c887..dde9f99bf 100644 --- a/Makefile +++ b/Makefile @@ -36,30 +36,30 @@ new: i18n/template.pot ## check that the auto.sh scripts work as expected check: clean - ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -q -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort < <(echo gsh); done; gsh stat' + ./utils/gameshell_archive.sh -at -N "game shell (1)" + ./"game shell (1).sh" -RFq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort < <(echo gsh); done; gsh stat' ## check that the auto.sh scripts work as expected, in verbose mode check-verbose: clean - ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Dq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort; done; gsh stat' + ./utils/gameshell_archive.sh -at -N "game shell (1)" + ./"game shell (1).sh" -RFDq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh auto --abort; done; gsh stat' ## run all the test.sh and auto.sh scripts tests-bash: clean - ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./utils/gameshell_archive.sh -at -N "game shell (1)" + ./"game shell (1).sh" -RFBdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' ## run all the test.sh and auto.sh scripts tests-zsh: clean - ./utils/archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -Zdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./utils/gameshell_archive.sh -at -N "game shell (1)" + ./"game shell (1).sh" -RFZdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' ## run all the test.sh and auto.sh scripts tests-lang: clean ./utils/gameshell_archive.sh -at -N "game shell (1)" - ./"game shell (1).sh" -L en -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' - ./"game shell (1).sh" -L fr -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' - ./"game shell (1).sh" -L it -Bdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -L en -RFBdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -L fr -RFBdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' + ./"game shell (1).sh" -L it -RFBdq -c 'gsh systemconfig; for _ in $$(seq 50); do gsh goal|cat; gsh test --abort; gsh auto --abort; done; gsh stat' clean: rm -rf i18n/*~ locale gameshell gameshell.tar gameshell.tgz gameshell.sh gameshell-save*.sh scripts/boxes-data.awk diff --git a/README-it.md b/README-it.md index 2a7141020..9509906e9 100644 --- a/README-it.md +++ b/README-it.md @@ -3,7 +3,7 @@ GameShell: un "gioco" per insegnare il terminale Unix ![Disegno ispirato dal gioco](Images/illustration-small.png) -Insegnare a studenti universitari o delle superiori a usare un terminale Unix non é la cosa piú semplice o divertente. Gameshell è stato creato come strumento per aiutare gli studenti alla [Université Savoie Mont Blanc](https://univ-smb.fr) per fare pratica con un terminale *reale* e imparare divertendosi. +Insegnare a studenti universitari o delle superiori a usare un terminale Unix non é la cosa piú semplice o divertente. GameShell è stato creato come strumento per aiutare gli studenti alla [Université Savoie Mont Blanc](https://univ-smb.fr) per fare pratica con un terminale *reale* e imparare divertendosi. L'idea originale, di Rodolphe Lepigre, era di avere una sessione da terminale standard, con una configurazione specifica via file, definiti "missioni", che potessero essere "validati" tramite i progressi nel gioco. diff --git a/doc/faq.md b/doc/faq.md index b2cd46e6e..137510ec1 100644 --- a/doc/faq.md +++ b/doc/faq.md @@ -54,7 +54,7 @@ Q. Can I use GameShell in the classroom? A. Of course! GameShell was initially developed for this very reason. Note that you can create your own GameShell archives with the missions you -want using the `GSH_ROOT/utils/archive.sh` script. You should probably +want using the `GSH_ROOT/utils/gameshell_archive.sh` script. You should probably - choose a password different from the default `gsh` (option `-p ...`) - activate the "passport" mode by default (option `-P`). The only diff --git a/doc/gameshell.md b/doc/gameshell.md index 4b107901f..066eae8c1 100644 --- a/doc/gameshell.md +++ b/doc/gameshell.md @@ -115,17 +115,17 @@ while creating missions (`gsh assert ...`, `gsh test`). -Creating an executable archive +Creating an executable [archive](archive) ------------------------------ -The script `utils/archive.sh` is used to create an executable archive to +The script `utils/gameshell_archive.sh` is used to create an executable archive to distribute a (customized) version of GameShell. By default, it creates an archive with all the missions listed in the `$GSH_ROOT/missions/index.txt` file and with all the available translations. You can choose the missions you want by listing them on the command line: ```sh -$ ./utils/archive.sh missions/basic/01_cd_tower missions/basic/02_cd.._cellar/ missions/basic/03_cd_HOME_throne/ +$ ./utils/gameshell_archive.sh missions/basic/01_cd_tower missions/basic/02_cd.._cellar/ missions/basic/03_cd_HOME_throne/ ``` If a directory contains an `index.txt` file, all the missions listed in it will be included. You can also give an `index.txt` file directly on the @@ -147,5 +147,5 @@ You can customize the archive with the following options More options are available and listed in the output of ```sh -$ ./utils/archive.sh -h +$ ./utils/gameshell_archive.sh -h ``` diff --git a/doc/misc.md b/doc/misc.md index 965446231..72224b287 100644 --- a/doc/misc.md +++ b/doc/misc.md @@ -36,10 +36,10 @@ $ ./GameShell/start.sh ### 3/ from an executable archive This is the easiest way to distribute GameShell to a group of students. Once you've -cloned the repository, create an executable archive with the `archive.sh` script: +cloned the repository, create an executable archive with the `gameshell_archive.sh` script: ```sh $ cd GameShell -$ ./utils/archive.sh +$ ./utils/gameshell_archive.sh copy missions -> copy basic/03_cd_HOME_throne -> copy basic/04_mkdir_chest diff --git a/i18n/en.po b/i18n/en.po index 318601640..de9c25562 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -1,11 +1,11 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-full-help/en.txt" +msgid "$GSH_ROOT/i18n/gsh-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-full-help/en.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-help/en.txt" +msgid "$GSH_ROOT/i18n/gsh-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-help/en.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt" @@ -166,8 +166,8 @@ msgstr "Error: wrong password." msgid "Error: you are not allowed to run this command." msgstr "Error: you are not allowed to run this command." -msgid "Error: you shouldn't run Gameshell as root!" -msgstr "Error: you shouldn't run Gameshell as root!" +msgid "Error: you shouldn't run GameShell as root!" +msgstr "Error: you shouldn't run GameShell as root!" msgid "Is this information correct? [Y/n]" msgstr "Is this information correct? [Y/n]" @@ -201,8 +201,8 @@ msgid "The directory $GSH_CONFIG contains meta-data from a previous game.\n" msgstr "The directory $GSH_CONFIG contains meta-data from a previous game.\n" "Do you want to remove it and start a new game? [y/N]" -msgid "The latest version of Gameshell is available at" -msgstr "The latest version of Gameshell is available at" +msgid "The latest version of GameShell is available at" +msgstr "The latest version of GameShell is available at" msgid "There are stopped jobs in your session.\n" "Those processes will be terminated.\n" diff --git a/i18n/fr.po b/i18n/fr.po index 8b8c400a5..7d26ca0f0 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -4,12 +4,12 @@ msgstr "Content-Type: text/plain; charset=UTF-8\n" "Plural-Forms: nplurals=2; plural=n>1;\n" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-full-help/fr.txt" +msgid "$GSH_ROOT/i18n/gsh-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-full-help/fr.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-help/fr.txt" +msgid "$GSH_ROOT/i18n/gsh-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-help/fr.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt" @@ -170,8 +170,8 @@ msgstr "Erreur : mauvais mot de passe." msgid "Error: you are not allowed to run this command." msgstr "Erreur : vous n'avez pas le droit d'exécuter cette commande." -msgid "Error: you shouldn't run Gameshell as root!" -msgstr "Erreur: il ne faut pas lancer Gameshell avec l'utilisateur root !" +msgid "Error: you shouldn't run GameShell as root!" +msgstr "Erreur: il ne faut pas lancer GameShell avec l'utilisateur root !" msgid "Is this information correct? [Y/n]" msgstr "Est-ce que ces informations sont correctes ? [O/n]" @@ -206,8 +206,8 @@ msgid "The directory $GSH_CONFIG contains meta-data from a previous game.\n" msgstr "Le répertoire $GSH_CONFIG contient des méta-données provenant d'une partie précédente.\n" "Voulez vous les supprimer et commencer une nouvelle partie ? [o/N]" -msgid "The latest version of Gameshell is available at" -msgstr "La dernière version de Gameshell est disponible sur" +msgid "The latest version of GameShell is available at" +msgstr "La dernière version de GameShell est disponible sur" msgid "There are stopped jobs in your session.\n" "Those processes will be terminated.\n" @@ -284,7 +284,7 @@ msgstr "O" msgid "You left GameShell's directory structure. Use\n" " $ cd\n" "to go back to the GameShell's starting directory." -msgstr "Vous avez quitté l'arborescence de Gameshell. Utilisez\n" +msgstr "Vous avez quitté l'arborescence de GameShell. Utilisez\n" " $ cd\n" "pour revenir au répertoire initial de GameShell." diff --git a/i18n/gameshell-help/fr.txt b/i18n/gameshell-help/fr.txt deleted file mode 100644 index afafdeeb3..000000000 --- a/i18n/gameshell-help/fr.txt +++ /dev/null @@ -1,21 +0,0 @@ -Commandes propres à GameShell -============================= - -gsh check - vérifie que l'objectif de la mission en cours - est atteint - -gsh exit / Control-d - quitte la partie en cours - (vous pouvez recommencer à la mission courante en - lançant GameShell avec l'option "-C") - -gsh goal [N] - affiche l'objectif de la mission en cours - si N est donné, affiche l'objectif de la mission N - -gsh help - affiche ce message - -gsh reset - ré-initialise la mission en cours diff --git a/i18n/gsh-full-help/README b/i18n/gsh-full-help/README new file mode 100644 index 000000000..55120ac60 --- /dev/null +++ b/i18n/gsh-full-help/README @@ -0,0 +1,2 @@ +DO NOT EDIT THOSE FILES DIRECTLY, THEY ARE GENERATED FROM THE FILES IN + ../source/gsh-commands diff --git a/i18n/gameshell-full-help/en.txt b/i18n/gsh-full-help/en.txt similarity index 68% rename from i18n/gameshell-full-help/en.txt rename to i18n/gsh-full-help/en.txt index 56adb23e5..2877da78d 100644 --- a/i18n/gameshell-full-help/en.txt +++ b/i18n/gsh-full-help/en.txt @@ -1,83 +1,103 @@ -Commands specific to GameShell -============================== +Full list of GameShell commands +=============================== -gsh assert condition [MSG] - check if the condition is true - if not, display an error message +This list of commands should also be available as a UNIX manual page: -gsh assert check true/false [MSG] - check the current mission's goal has been achieved - if the result doesn't coincide with the expected result, display - an error message + man gsh -gsh auto (ADMIN) - source the current mission's automatic script, if it exists -gsh check - check whether the current mission's goal has been achieved or - not +Player commands +--------------- -gsh env - display internal environment variables +gsh check + check whether the current mission's goal has been + achieved or not gsh exit - quit (and save) the current game + quit GameShell + Note that you can exit GameShell using Control-d as well gsh goal [N] show the current mission's goal if N is given, show the goal for mission N -gsh goto [N] (ADMIN) +gsh help + short help message + +gsh reset + reset the current mission + + +Admin commands +-------------- + +gsh auto + source the current mission's automatic script, if it exists + +gsh goto [N] directly go to mission N - (no password necessary if N is a previous mission) + (Note: no password necessary if N is a previous mission) -gsh hardreset - reset the current mission by restarting the shell +gsh skip + give up on the current mission and go to the next one + (no password necessary if the mission was completed at least + once) -gsh HELP - this message -gsh help - shorter help message +Additional commands +------------------- gsh index show list of missions, with their status +gsh stat + display simple statistics about completed missions + +gsh version + show GameShell's version + +gsh welcome + show the welcome message + + +Developpers commands +-------------------- + +gsh assert condition [MSG] + check if the condition is true + if not, display an error message + +gsh assert check true/false [MSG] + check the current mission's goal has been achieved + if the result doesn't coincide with the expected result, display + an error message + +gsh env + display internal environment variables + +gsh hardreset + reset the current mission by restarting the shell + +gsh HELP + this message + gsh log [-v] show the log file of gsh commands gsh pcm print the current mission number -gsh protect -gsh unprotect +gsh protect and gsh unprotect add / remove protection on GameShell directories -gsh reset - reset the current mission - gsh resetstatic regenerate all the static parts of the world gsh save FILENAME save the current game to file -gsh skip (ADMIN) - give up on the current mission and go to the next one - (no password necessary if the mission was completed at least - once) - -gsh stat - display simple statistics about completed missions - gsh systemconfig display the system configuration gsh test run the current mission's test script, if it exists - -gsh version - show Gameshell's version - -gsh welcome - show the welcome message diff --git a/i18n/gameshell-full-help/fr.txt b/i18n/gsh-full-help/fr.txt similarity index 75% rename from i18n/gameshell-full-help/fr.txt rename to i18n/gsh-full-help/fr.txt index c38684871..3cd3aeb82 100644 --- a/i18n/gameshell-full-help/fr.txt +++ b/i18n/gsh-full-help/fr.txt @@ -1,84 +1,105 @@ -Commandes propres à GameShell -============================= +Liste de toutes les commandes GameShell +======================================= -gsh assert condition [MSG] - vérifie si la condition est vraie, - sinon, affiche un message d'erreur +Cette liste devrait être accessible dans une page de manuel UNIX : -gsh assert_check true/false [MSG] - vérifie si l'objectif de la mission en cours est atteint - si le résultat ne correspond pas au résultat attendu, affiche un - message d'erreur + man gsh -gsh auto (ADMIN) - lance le script automatique de la mission en cours, s'il existe. + +Commandes pour le joueur +------------------------ gsh check vérifie que l'objectif de la mission en cours est atteint -gsh env - affiche les variables d'environnement internes - gsh exit quitte (et sauvegarde) la partie en cours + vous pouvez également quitter avec Contrôle-d gsh goal [N] affiche l'objectif de la mission en cours si N est donné, affiche l'objectif de la mission N -gsh goto [N] (ADMIN) +gsh help + affiche un petit message d'aide + +gsh reset + ré-initialise la mission en cours + + +Commandes d'administration +-------------------------- + +gsh auto + lance le script automatique de la mission en cours, s'il existe. + +gsh goto [N] passe directement à la mission N (le mot de passe n'est pas nécessaire si N est une mission précédente) -gsh hardreset - ré-initialise la mission en cours en redémarrant le shell +gsh skip + abandonne la mission en cours et passe à la suivante + (le mot de passe n'est pas nécessaire si la mission a déjà été + réussie) -gsh HELP - affiche ce message -gsh help - affiche un petit message d'aide + +Commandes supplémentaires +------------------------- gsh index affiche la liste des missions, avec leur statut +gsh stat [-v] + affiche des statistiques simples sur les missions effectuées + +gsh version + affiche la version de GameShell + +gsh welcome + affiche le message de bienvenue + + +Commandes pour les développeurs +------------------------------- + +gsh assert condition [MSG] + vérifie si la condition est vraie + sinon, affiche un message d'erreur + +gsh assert_check true/false [MSG] + vérifie si l'objectif de la mission en cours est atteint + si le résultat ne correspond pas au résultat attendu, affiche un + message d'erreur + +gsh env + affiche les variables d'environnement internes + +gsh hardreset + ré-initialise la mission en cours en redémarrant le shell + +gsh HELP + affiche ce message + gsh log [-v] affiche le fichier de log des commandes gsh gsh pcm affiche le numéro de mission courant ("print current mission") -gsh protect -gsh unprotect +gsh protect et gsh unprotect ajoute / supprime les protections d'accès sur les répertoires de GameShell -gsh reset - ré-initialise la mission en cours - gsh resetstatic re-génère toutes les parties statique du monde gsh save FICHIER sauve la partie actuelle dans le fichier -gsh skip (ADMIN) - abandonne la mission en cours et passe à la suivante - (le mot de passe n'est pas nécessaire si la mission a déjà été - réussie) - -gsh stat [-v] - affiche des statistiques simples sur les missions effectuées - gsh systemconfig affiche la configuration du système gsh test lance le script de test de la mission en cours, s'il existe - -gsh version - affiche la version de Gameshell - -gsh welcome - affiche le message de bienvenue diff --git a/i18n/gameshell-full-help/it.txt b/i18n/gsh-full-help/it.txt similarity index 98% rename from i18n/gameshell-full-help/it.txt rename to i18n/gsh-full-help/it.txt index fefcc545b..36a950cd4 100644 --- a/i18n/gameshell-full-help/it.txt +++ b/i18n/gsh-full-help/it.txt @@ -79,7 +79,7 @@ gsh test avvia i test della missione attuale, se esiste gsh version - mostra la versione di Gameshell + mostra la versione di GameShell gsh welcome mostra il messaggio di benvenuto diff --git a/i18n/gsh-help/README b/i18n/gsh-help/README new file mode 100644 index 000000000..55120ac60 --- /dev/null +++ b/i18n/gsh-help/README @@ -0,0 +1,2 @@ +DO NOT EDIT THOSE FILES DIRECTLY, THEY ARE GENERATED FROM THE FILES IN + ../source/gsh-commands diff --git a/i18n/gameshell-help/en.txt b/i18n/gsh-help/en.txt similarity index 59% rename from i18n/gameshell-help/en.txt rename to i18n/gsh-help/en.txt index c9af61b22..9ba0d0bbb 100644 --- a/i18n/gameshell-help/en.txt +++ b/i18n/gsh-help/en.txt @@ -5,17 +5,16 @@ gsh check check whether the current mission's goal has been achieved or not -gsh exit / Control-d +gsh exit quit GameShell - (you can start from the current mission by running - GameShell with the "-C" flag) + Note that you can exit GameShell using Control-d as well gsh goal [N] show the current mission's goal - if n is given, show the goal for mission N + if N is given, show the goal for mission N gsh help - shorter help message + short help message gsh reset reset the current mission diff --git a/i18n/gsh-help/fr.txt b/i18n/gsh-help/fr.txt new file mode 100644 index 000000000..4dc4142b5 --- /dev/null +++ b/i18n/gsh-help/fr.txt @@ -0,0 +1,19 @@ +Commandes GameShell standard +============================ + +gsh check + vérifie que l'objectif de la mission en cours est atteint + +gsh exit + quitte (et sauvegarde) la partie en cours + vous pouvez également quitter avec Contrôle-d + +gsh goal [N] + affiche l'objectif de la mission en cours + si N est donné, affiche l'objectif de la mission N + +gsh help + affiche un petit message d'aide + +gsh reset + ré-initialise la mission en cours diff --git a/i18n/gameshell-help/it.txt b/i18n/gsh-help/it.txt similarity index 53% rename from i18n/gameshell-help/it.txt rename to i18n/gsh-help/it.txt index b504b28fd..6a1eb9677 100644 --- a/i18n/gameshell-help/it.txt +++ b/i18n/gsh-help/it.txt @@ -2,13 +2,11 @@ Comandi specifici di GameShell ============================== gsh check - verifica se gli obiettivi della missione corrente - sono stati raggiunti + verifica se gli obiettivi della missione attuale sono stati raggiunti + o no -gsh exit / Control-d +gsh exit esci da GameShell - (puoi partire dalla missione corrente eseguendo - GameShell con il parametro "-C") gsh goal [N] mostra gli obiettivi della missione @@ -18,4 +16,5 @@ gsh help messaggio di aiuto breve gsh reset - reimposta la missione corrente + reimposta la missione attuale + diff --git a/i18n/it.po b/i18n/it.po index fe6f18822..bffb14dbd 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -14,12 +14,12 @@ msgstr "Project-Id-Version: \n" "X-Generator: Lokalize 22.04.1\n" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-full-help/it.txt" +msgid "$GSH_ROOT/i18n/gsh-full-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-full-help/it.txt" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" -msgstr "$GSH_ROOT/i18n/gameshell-help/it.txt" +msgid "$GSH_ROOT/i18n/gsh-help/en.txt" +msgstr "$GSH_ROOT/i18n/gsh-help/it.txt" #, sh-format msgid "$GSH_ROOT/i18n/gameshell-init-msg-short/en.txt" @@ -180,8 +180,8 @@ msgstr "Errore: password sbagliata." msgid "Error: you are not allowed to run this command." msgstr "Errore: non hai i permessi per eseguire questo comando." -msgid "Error: you shouldn't run Gameshell as root!" -msgstr "Errore: non dovresti eseguire Gameshell come root!" +msgid "Error: you shouldn't run GameShell as root!" +msgstr "Errore: non dovresti eseguire GameShell come root!" msgid "Is this information correct? [Y/n]" msgstr "Questa informazione é corretta? [S/n]" @@ -215,8 +215,8 @@ msgid "The directory $GSH_CONFIG contains meta-data from a previous game.\n" msgstr "La cartella $GSH_CONFIG contiene informazioni da una partita precedente.\n" "Vuoi cancellare questi dati e lanciare una nuova partita?[s/N]" -msgid "The latest version of Gameshell is available at" -msgstr "L'ultima versione di Gameshell é disponibile a" +msgid "The latest version of GameShell is available at" +msgstr "L'ultima versione di GameShell é disponibile a" msgid "There are stopped jobs in your session.\n" "Those processes will be terminated.\n" @@ -293,9 +293,9 @@ msgstr "S" msgid "You left GameShell's directory structure. Use\n" " $ cd\n" "to go back to the GameShell's starting directory." -msgstr "Hai lasciato la struttura di cartelle di Gameshell . Usa\n" +msgstr "Hai lasciato la struttura di cartelle di GameShell . Usa\n" " $ cd\n" - "per tornare indietro alla cartella iniziale di Gameshell." + "per tornare indietro alla cartella iniziale di GameShell." msgid "[Press space to continue, q to quit\\.]" msgstr "[Premi invio per continuare, q per uscire\\.]" diff --git a/i18n/source/clean.sed b/i18n/source/clean.sed new file mode 100755 index 000000000..14074b88d --- /dev/null +++ b/i18n/source/clean.sed @@ -0,0 +1,16 @@ +#!/usr/bin/sed -f + +# remove trailing '::' for asciidoc's descriptions +s/::$// + +# replace leading tabs used by asciidoc's descriptions by spaces +s/^\t/ / + +# remove asciidoc's bold +s/\*\*//g + +# remove asciidoc's italic +s/__//g + +# remove trailing ' +' for asciidoc hard linebreaks +s/ +$// diff --git a/i18n/source/gsh-commands/Makefile b/i18n/source/gsh-commands/Makefile new file mode 100644 index 000000000..7f0e22a90 --- /dev/null +++ b/i18n/source/gsh-commands/Makefile @@ -0,0 +1,44 @@ +MANPATH = ../../../man +HELPPATH = ../.. + +LANGS = en fr +MANPAGES = $(addsuffix .1, $(LANGS)) +HELPFILES = $(addsuffix .help, $(LANGS)) +FULLHELPFILES = $(addsuffix .full_help, $(LANGS)) + +clean = sed -f ../clean.sed +include_files = awk -f ../include_files.awk + +all: $(MANPAGES) $(HELPFILES) $(FULLHELPFILES) + +install: all + @mkdir -p $(MANPATH)/man1/ + for file in ??.1; do mkdir -p $(MANPATH)/$${file%.1}/man1/; cp "$$file" "$(MANPATH)/$${file%.1}/man1/gsh.1"; done + mv $(MANPATH)/en/man1/* $(MANPATH)/man1/ + rmdir $(MANPATH)/en/man1/ + for file in ??.full_help; do cp "$$file" "$(HELPPATH)/gsh-full-help/$${file%.full_help}.txt"; done + for file in ??.help; do cp "$$file" "$(HELPPATH)/gsh-help/$${file%.help}.txt"; done + +%.txt: %/*.txt + $(include_files) $*/man_gsh.txt > $@ + +# NOTE: english man page should go to the default man/man1 directory +en.1: en.txt + a2x --doctype manpage --format manpage $< + mv gsh.1 $@ + +# NOTE: translated man pages should go to the man/LANGUAGE/man1 directory +%.1: %.txt + a2x --doctype manpage --format manpage $< + mv gsh.1 $@ + +%.full_help: %/*.txt + $(include_files) $*/gsh_full_help.txt | $(clean) > $@ + +%.help: %/*.txt + $(include_files) $*/gsh_help.txt | $(clean) > $@ + +clean: + rm -f *.1 *.html *.txt *.help *.full_help + +.PHONY: clean all diff --git a/i18n/source/gsh-commands/en.1 b/i18n/source/gsh-commands/en.1 new file mode 100644 index 000000000..a91570400 --- /dev/null +++ b/i18n/source/gsh-commands/en.1 @@ -0,0 +1,268 @@ +'\" t +.\" Title: gsh +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 03/13/2025 +.\" Manual: \ \& +.\" Source: \ \& +.\" Language: English +.\" +.TH "GSH" "1" "03/13/2025" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gsh \- GameShell specific commands invocation +.SH "SYNOPSIS" +.sp +\fBgsh\fR <\fICOMMAND\fR> +.SH "DESCRIPTION" +.sp +GameShell is a game for learning (and teaching) how to use a POSIX shell\&. +.sp +Almost all the commands encountered during a game are standard Unix commands, with the notable exception of the commands needed to interact with GameShell itself\&. All those interaction start with \fBgsh\fR, followed by a subcommand\&. +.SH "NOTE" +.sp +On standard Unix systems, you should be able to quit this manual by pressing the "q" key\&. +.sp +You should be able to scroll using the Space key or the arrow keys\&. +.sp +You can search through this page by pressing on the "/" key, followed by the pattern you are searching\&. Pressing "n" (for "next") or "p" (for "previous") will jump to the next / previous occurrence of the search pattern\&. +.SH "COMMANDS" +.SS "Standard player commands" +.sp +Under normal circumstances, a player shouldn\(cqt need to use more than the following commands\&. +.PP +\fBgsh check\fR +.RS 4 +check whether the current mission\(cqs goal has been achieved or not +.RE +.PP +\fBgsh exit\fR +.RS 4 +quit GameShell + +Note that you can exit GameShell using Control\-d as well +.RE +.PP +\fBgsh goal\fR [\fIN\fR] +.RS 4 +show the current mission\(cqs goal + +if +\fIN\fR +is given, show the goal for mission +\fIN\fR +.RE +.PP +\fBgsh help\fR +.RS 4 +short help message +.RE +.PP +\fBgsh reset\fR +.RS 4 +reset the current mission +.RE +.SS "Admin commands" +.sp +Some commands are only accessible when the player knows the secret "GameShell administrator password"\&. Those commands make it possible to skip missions\&. +.sp +The password for the standard GameShell is simply "gsh" but if you\(cqre using GameShell in the classroom, your instructor has probably changed it to something else! +.PP +\fBgsh auto\fR +.RS 4 +source the current mission\(cqs automatic script, if it exists +.RE +.PP +\fBgsh goto\fR [\fIN\fR] +.RS 4 +directly go to mission +\fIN\fR +(Note: no password necessary if +\fIN\fR +is an earlier mission) +.RE +.PP +\fBgsh skip\fR +.RS 4 +give up on the current mission and go to the next one + +(no password necessary if the mission was completed at least once) +.RE +.SS "Additional commands" +.sp +There are a couple of additional commands that can give information about the game\&. Except for the \fBindex\fR subcommand, they aren\(cqt very interesting for the player\&. +.PP +\fBgsh index\fR +.RS 4 +show list of missions, with their status +.RE +.PP +\fBgsh stat\fR +.RS 4 +display simple statistics about completed missions +.RE +.PP +\fBgsh version\fR +.RS 4 +show GameShell\(cqs version +.RE +.PP +\fBgsh welcome\fR +.RS 4 +show the welcome message +.RE +.SS "Developer and administration commands" +.sp +The following commands are only useful for GameShell developers\&. Player should probably avoid them\&. +.PP +\fBgsh assert condition\fR [\fIMSG\fR] +.RS 4 +check if the condition is true + +if not, display an error message +.RE +.PP +\fBgsh assert check true/false\fR [\fIMSG\fR] +.RS 4 +check the current mission\(cqs goal has been achieved + +if the result doesn\(cqt coincide with the expected result, display an error message +.RE +.PP +\fBgsh env\fR +.RS 4 +display internal environment variables +.RE +.PP +\fBgsh hardreset\fR +.RS 4 +reset the current mission by restarting the shell +.RE +.PP +\fBgsh HELP\fR +.RS 4 +show advanced usage status, with all existing Gameshell commands +.RE +.PP +\fBgsh log\fR [\fB\-v\fR] +.RS 4 +show the log file of gsh commands +.RE +.PP +\fBgsh pcm\fR +.RS 4 +print the current mission number +.RE +.PP +\fBgsh protect\fR and \fBgsh unprotect\fR +.RS 4 +add / remove protection on GameShell directories +.RE +.PP +\fBgsh resetstatic\fR +.RS 4 +regenerate all the static parts of the world +.RE +.PP +\fBgsh save\fR \fIFILENAME\fR +.RS 4 +save the current game to file +.RE +.PP +\fBgsh systemconfig\fR +.RS 4 +display the system configuration +.RE +.PP +\fBgsh test\fR +.RS 4 +run the current mission\(cqs test script, if it exists +.RE +.SH "AUTHORS" +.sp +GameShell was originally developed by Pierre Hyvernat and Rodolphe Lepigre at Université Savoie Mont Blanc, based on an idea from Rodolphe Lepigre\&. Several people have contributed individual missions, bug reports, bug fixes and translations\&. +.sp +It is currently maintained and developed by Pierre Hyvernat\&. +.SH "REPORTING BUGS" +.sp +The best way to report bug is by opening an issue on github: https://github\&.com/phyver/GameShell/issues +.sp +You can also send an email directly to with a description of your problem\&. +.sp +Please include +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a description of the problem +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +the version of GameShell you are using (cf +\fBgsh version\fR, or the +\fB\-V\fR +option of the GameShell script) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +the output of the +\fBgsh env\fR +command, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +any additional relevant information\&. +.RE +.SH "SEE ALSO" +.sp +\fIbash\fR(1), \fIzsh\fR(1), \fIsh\fR(1), \fIgameshell\&.sh\fR(1) +.SH "GAMESHELL" +.sp +GameShell source code is hosted on github: https://github\&.com/phyver/GameShell +.SH "LICENCE" +.sp +GNU General Public Licence version 3, "GPLV3", https://www\&.gnu\&.org/licenses/gpl\-3\&.0\&.html diff --git a/i18n/source/gsh-commands/en.full_help b/i18n/source/gsh-commands/en.full_help new file mode 100644 index 000000000..5039f68c3 --- /dev/null +++ b/i18n/source/gsh-commands/en.full_help @@ -0,0 +1,103 @@ +Full list of GameShell commands +=============================== + +This list of commands should also be available as a UNIX manual page: + + man gsh + + +Player commands +--------------- + +gsh check + check whether the current mission's goal has been + achieved or not + +gsh exit + quit GameShell + Note that you can exit GameShell using Control-d as well + +gsh goal [N] + show the current mission's goal + if N is given, show the goal for mission N + +gsh help + short help message + +gsh reset + reset the current mission + + +Admin commands +-------------- + +gsh auto + source the current mission's automatic script, if it exists + +gsh goto [N] + directly go to mission N + (Note: no password necessary if N is an earlier mission) + +gsh skip + give up on the current mission and go to the next one + (no password necessary if the mission was completed at least + once) + + +Additional commands +------------------- + +gsh index + show list of missions, with their status + +gsh stat + display simple statistics about completed missions + +gsh version + show GameShell's version + +gsh welcome + show the welcome message + + +Developpers commands +-------------------- + +gsh assert condition [MSG] + check if the condition is true + if not, display an error message + +gsh assert check true/false [MSG] + check the current mission's goal has been achieved + if the result doesn't coincide with the expected result, display + an error message + +gsh env + display internal environment variables + +gsh hardreset + reset the current mission by restarting the shell + +gsh HELP + show advanced usage status, with all existing Gameshell commands + +gsh log [-v] + show the log file of gsh commands + +gsh pcm + print the current mission number + +gsh protect and gsh unprotect + add / remove protection on GameShell directories + +gsh resetstatic + regenerate all the static parts of the world + +gsh save FILENAME + save the current game to file + +gsh systemconfig + display the system configuration + +gsh test + run the current mission's test script, if it exists diff --git a/i18n/source/gsh-commands/en.help b/i18n/source/gsh-commands/en.help new file mode 100644 index 000000000..9ba0d0bbb --- /dev/null +++ b/i18n/source/gsh-commands/en.help @@ -0,0 +1,20 @@ +Commands specific to GameShell +============================== + +gsh check + check whether the current mission's goal has been + achieved or not + +gsh exit + quit GameShell + Note that you can exit GameShell using Control-d as well + +gsh goal [N] + show the current mission's goal + if N is given, show the goal for mission N + +gsh help + short help message + +gsh reset + reset the current mission diff --git a/i18n/source/gsh-commands/en.txt b/i18n/source/gsh-commands/en.txt new file mode 100644 index 000000000..e4d94146b --- /dev/null +++ b/i18n/source/gsh-commands/en.txt @@ -0,0 +1,174 @@ +gsh(1) +====== + +NAME +---- +gsh - GameShell specific commands invocation + +SYNOPSIS +-------- +**gsh** <__COMMAND__> + +DESCRIPTION +----------- +GameShell is a game for learning (and teaching) how to use a POSIX shell. + +Almost all the commands encountered during a game are standard Unix commands, +with the notable exception of the commands needed to interact with GameShell +itself. All those interaction start with **gsh**, followed by a subcommand. + +NOTE +---- +On standard Unix systems, you should be able to quit this manual by pressing +the "q" key. + +You should be able to scroll using the Space key or the arrow keys. + +You can search through this page by pressing on the "/" key, followed by the +pattern you are searching. Pressing "n" (for "next") or "p" (for "previous") +will jump to the next / previous occurrence of the search pattern. + +COMMANDS +-------- +Standard player commands +~~~~~~~~~~~~~~~~~~~~~~~~ +Under normal circumstances, a player shouldn't need to use more than the +following commands. + +**gsh check**:: + check whether the current mission's goal has been + achieved or not + +**gsh exit**:: + quit GameShell + + Note that you can exit GameShell using Control-d as well + +**gsh goal** [__N__]:: + show the current mission's goal + + if __N__ is given, show the goal for mission __N__ + +**gsh help**:: + short help message + +**gsh reset**:: + reset the current mission + +Admin commands +~~~~~~~~~~~~~~ +Some commands are only accessible when the player knows the secret "GameShell +administrator password". Those commands make it possible to skip missions. + +The password for the standard GameShell is simply "gsh" but if you're using +GameShell in the classroom, your instructor has probably changed it to +something else! + +**gsh auto**:: + source the current mission's automatic script, if it exists + +**gsh goto** [__N__]:: + directly go to mission __N__ + + (Note: no password necessary if __N__ is an earlier mission) + +**gsh skip**:: + give up on the current mission and go to the next one + + (no password necessary if the mission was completed at least + once) + +Additional commands +~~~~~~~~~~~~~~~~~~~ +There are a couple of additional commands that can give information about the +game. Except for the **index** subcommand, they aren't very interesting for +the player. + +**gsh index**:: + show list of missions, with their status + +**gsh stat**:: + display simple statistics about completed missions + +**gsh version**:: + show GameShell's version + +**gsh welcome**:: + show the welcome message + +Developer and administration commands +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following commands are only useful for GameShell developers. Player +should probably avoid them. + +**gsh assert condition** [__MSG__]:: + check if the condition is true + + if not, display an error message + +**gsh assert check true/false** [__MSG__]:: + check the current mission's goal has been achieved + + if the result doesn't coincide with the expected result, display + an error message + +**gsh env**:: + display internal environment variables + +**gsh hardreset**:: + reset the current mission by restarting the shell + +**gsh HELP**:: + show advanced usage status, with all existing Gameshell commands + +**gsh log** [**-v**]:: + show the log file of gsh commands + +**gsh pcm**:: + print the current mission number + +**gsh protect** and **gsh unprotect**:: + add / remove protection on GameShell directories + +**gsh resetstatic**:: + regenerate all the static parts of the world + +**gsh save** __FILENAME__:: + save the current game to file + +**gsh systemconfig**:: + display the system configuration + +**gsh test**:: + run the current mission's test script, if it exists + +Authors +------- +GameShell was originally developed by Pierre Hyvernat and Rodolphe Lepigre at +Université Savoie Mont Blanc, based on an idea from Rodolphe Lepigre. Several +people have contributed individual missions, bug reports, bug fixes and +translations. + +It is currently maintained and developed by Pierre Hyvernat. + +Reporting Bugs +-------------- +The best way to report bug is by opening an issue on github: https://github.com/phyver/GameShell/issues + +You can also send an email directly to with a +description of your problem. + +Please include + +* a description of the problem +* the version of GameShell you are using (cf **gsh version**, or the **-V** + option of the GameShell script) +* the output of the **gsh env** command, +* any additional relevant information. + + +SEE ALSO +-------- +__bash__(1), __zsh__(1), __sh__(1), __gameshell.sh__(1) + +GAMESHELL +--------- +GameShell source code is hosted on github: https://github.com/phyver/GameShell + +LICENCE +------- +GNU General Public Licence version 3, "GPLV3", https://www.gnu.org/licenses/gpl-3.0.html diff --git a/i18n/source/gsh-commands/en/commands_admin.txt b/i18n/source/gsh-commands/en/commands_admin.txt new file mode 100644 index 000000000..2591f32dd --- /dev/null +++ b/i18n/source/gsh-commands/en/commands_admin.txt @@ -0,0 +1,11 @@ +**gsh auto**:: + source the current mission's automatic script, if it exists + +**gsh goto** [__N__]:: + directly go to mission __N__ + + (Note: no password necessary if __N__ is an earlier mission) + +**gsh skip**:: + give up on the current mission and go to the next one + + (no password necessary if the mission was completed at least + once) diff --git a/i18n/source/gsh-commands/en/commands_dev.txt b/i18n/source/gsh-commands/en/commands_dev.txt new file mode 100644 index 000000000..c45032ee3 --- /dev/null +++ b/i18n/source/gsh-commands/en/commands_dev.txt @@ -0,0 +1,38 @@ +**gsh assert condition** [__MSG__]:: + check if the condition is true + + if not, display an error message + +**gsh assert check true/false** [__MSG__]:: + check the current mission's goal has been achieved + + if the result doesn't coincide with the expected result, display + an error message + +**gsh env**:: + display internal environment variables + +**gsh hardreset**:: + reset the current mission by restarting the shell + +**gsh HELP**:: + show advanced usage status, with all existing Gameshell commands + +**gsh log** [**-v**]:: + show the log file of gsh commands + +**gsh pcm**:: + print the current mission number + +**gsh protect** and **gsh unprotect**:: + add / remove protection on GameShell directories + +**gsh resetstatic**:: + regenerate all the static parts of the world + +**gsh save** __FILENAME__:: + save the current game to file + +**gsh systemconfig**:: + display the system configuration + +**gsh test**:: + run the current mission's test script, if it exists diff --git a/i18n/source/gsh-commands/en/commands_misc.txt b/i18n/source/gsh-commands/en/commands_misc.txt new file mode 100644 index 000000000..7bc94b4b9 --- /dev/null +++ b/i18n/source/gsh-commands/en/commands_misc.txt @@ -0,0 +1,11 @@ +**gsh index**:: + show list of missions, with their status + +**gsh stat**:: + display simple statistics about completed missions + +**gsh version**:: + show GameShell's version + +**gsh welcome**:: + show the welcome message diff --git a/i18n/source/gsh-commands/en/commands_standard.txt b/i18n/source/gsh-commands/en/commands_standard.txt new file mode 100644 index 000000000..3a817f994 --- /dev/null +++ b/i18n/source/gsh-commands/en/commands_standard.txt @@ -0,0 +1,17 @@ +**gsh check**:: + check whether the current mission's goal has been + achieved or not + +**gsh exit**:: + quit GameShell + + Note that you can exit GameShell using Control-d as well + +**gsh goal** [__N__]:: + show the current mission's goal + + if __N__ is given, show the goal for mission __N__ + +**gsh help**:: + short help message + +**gsh reset**:: + reset the current mission diff --git a/i18n/source/gsh-commands/en/gsh_full_help.txt b/i18n/source/gsh-commands/en/gsh_full_help.txt new file mode 100644 index 000000000..f873d126e --- /dev/null +++ b/i18n/source/gsh-commands/en/gsh_full_help.txt @@ -0,0 +1,30 @@ +Full list of GameShell commands +=============================== + +This list of commands should also be available as a UNIX manual page: + + man gsh + + +Player commands +--------------- + +INCLUDE en/commands_standard.txt + + +Admin commands +-------------- + +INCLUDE en/commands_admin.txt + + +Additional commands +------------------- + +INCLUDE en/commands_misc.txt + + +Developpers commands +-------------------- + +INCLUDE en/commands_dev.txt diff --git a/i18n/source/gsh-commands/en/gsh_help.txt b/i18n/source/gsh-commands/en/gsh_help.txt new file mode 100644 index 000000000..03797ab3a --- /dev/null +++ b/i18n/source/gsh-commands/en/gsh_help.txt @@ -0,0 +1,4 @@ +Commands specific to GameShell +============================== + +INCLUDE en/commands_standard.txt diff --git a/i18n/source/gsh-commands/en/man_gsh.txt b/i18n/source/gsh-commands/en/man_gsh.txt new file mode 100644 index 000000000..d131222d1 --- /dev/null +++ b/i18n/source/gsh-commands/en/man_gsh.txt @@ -0,0 +1,101 @@ +gsh(1) +====== + +NAME +---- +gsh - GameShell specific commands invocation + +SYNOPSIS +-------- +**gsh** <__COMMAND__> + +DESCRIPTION +----------- +GameShell is a game for learning (and teaching) how to use a POSIX shell. + +Almost all the commands encountered during a game are standard Unix commands, +with the notable exception of the commands needed to interact with GameShell +itself. All those interaction start with **gsh**, followed by a subcommand. + +NOTE +---- +On standard Unix systems, you should be able to quit this manual by pressing +the "q" key. + +You should be able to scroll using the Space key or the arrow keys. + +You can search through this page by pressing on the "/" key, followed by the +pattern you are searching. Pressing "n" (for "next") or "p" (for "previous") +will jump to the next / previous occurrence of the search pattern. + +COMMANDS +-------- +Standard player commands +~~~~~~~~~~~~~~~~~~~~~~~~ +Under normal circumstances, a player shouldn't need to use more than the +following commands. + +INCLUDE en/commands_standard.txt + +Admin commands +~~~~~~~~~~~~~~ +Some commands are only accessible when the player knows the secret "GameShell +administrator password". Those commands make it possible to skip missions. + +The password for the standard GameShell is simply "gsh" but if you're using +GameShell in the classroom, your instructor has probably changed it to +something else! + +INCLUDE en/commands_admin.txt + +Additional commands +~~~~~~~~~~~~~~~~~~~ +There are a couple of additional commands that can give information about the +game. Except for the **index** subcommand, they aren't very interesting for +the player. + +INCLUDE en/commands_misc.txt + +Developer and administration commands +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following commands are only useful for GameShell developers. Player +should probably avoid them. + +INCLUDE en/commands_dev.txt + +Authors +------- +GameShell was originally developed by Pierre Hyvernat and Rodolphe Lepigre at +Université Savoie Mont Blanc, based on an idea from Rodolphe Lepigre. Several +people have contributed individual missions, bug reports, bug fixes and +translations. + +It is currently maintained and developed by Pierre Hyvernat. + +Reporting Bugs +-------------- +The best way to report bug is by opening an issue on github: https://github.com/phyver/GameShell/issues + +You can also send an email directly to with a +description of your problem. + +Please include + +* a description of the problem +* the version of GameShell you are using (cf **gsh version**, or the **-V** + option of the GameShell script) +* the output of the **gsh env** command, +* any additional relevant information. + + +SEE ALSO +-------- +__bash__(1), __zsh__(1), __sh__(1), __gameshell.sh__(1) + +GAMESHELL +--------- +GameShell source code is hosted on github: https://github.com/phyver/GameShell + +LICENCE +------- +GNU General Public Licence version 3, "GPLV3", https://www.gnu.org/licenses/gpl-3.0.html diff --git a/i18n/source/gsh-commands/fr.1 b/i18n/source/gsh-commands/fr.1 new file mode 100644 index 000000000..9288b565e --- /dev/null +++ b/i18n/source/gsh-commands/fr.1 @@ -0,0 +1,267 @@ +'\" t +.\" Title: gsh +.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 03/13/2025 +.\" Manual: \ \& +.\" Source: \ \& +.\" Language: English +.\" +.TH "GSH" "1" "03/13/2025" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gsh \- exécute les commandes spécifiques de GameShell +.SH "SYNOPSIS" +.sp +\fBgsh\fR <\fICOMMANDE\fR> +.SH "DESCRIPTION" +.sp +GameShell est un jeu pour apprendre (et enseigner) l\(cqutilisation d\(cqun shell POSIX\&. +.sp +Presque toutes les commandes rencontrées pendant une partie sont des commandes Unix standard, à l\(cqexception notable des commandes nécessaires pour interagir avec GameShell lui même\&. Toutes ces commandes commencent par \fBgsh\fR, suivi d\(cqune sous\-commande\&. +.SH "NOTE" +.sp +Sur un système Unix standard, vous devriez pouvoir quitter ce manuel en appuyant sur la touche "q"\&. +.sp +Vous devriez pouvoir faire défiler le texte avec la touche Espace ou les flèches\&. +.sp +Vous pouvez chercher dans le manuel en appuyant sur la touche "/", puis en entrant le motif que vous recherchez\&. Un appui sur les touches "n" (pour "next") ou "p" (pour "previous") déplacera le texte à l\(cqoccurrence suivante ou précédente du motif\&. +.SH "COMMANDES" +.SS "Commandes standard pour le joueur" +.sp +Normalement, le joueur ne devrait pas avoir besoin d\(cqautres commandes que les suivantes\&. +.PP +\fBgsh check\fR +.RS 4 +vérifie que l\(cqobjectif de la mission en cours est atteint +.RE +.PP +\fBgsh exit\fR +.RS 4 +quitte (et sauvegarde) la partie en cours + +vous pouvez également quitter avec Contrôle\-d +.RE +.PP +\fBgsh goal\fR [\fIN\fR] +.RS 4 +affiche l\(cqobjectif de la mission en cours + +si +\fIN\fR +est donné, affiche l\(cqobjectif de la mission +\fIN\fR +.RE +.PP +\fBgsh help\fR +.RS 4 +affiche un petit message d\(cqaide +.RE +.PP +\fBgsh reset\fR +.RS 4 +ré\-initialise la mission en cours +.RE +.SS "Commandes pour l\(cqadministrateur" +.sp +Quelques commandes sont seulement utilisables si le joueurs connait le mot de passe secret de GameShell\&. Ces commandes permettent par exemple de sauter une mission fait partie\&. +.sp +Le mot de passe par défaut est simplement "gsh" mais si vous utilisez GameShell en classe, votre encadrant l\(cqa probablement changé ! +.PP +\fBgsh auto\fR +.RS 4 +lance le script automatique de la mission en cours, s\(cqil existe\&. +.RE +.PP +\fBgsh goto\fR [\fIN\fR] +.RS 4 +passe directement à la mission +\fIN\fR +(le mot de passe n\(cqest pas nécessaire si +\fIN\fR +est une mission précédente) +.RE +.PP +\fBgsh skip\fR +.RS 4 +abandonne la mission en cours et passe à la suivante + +(le mot de passe n\(cqest pas nécessaire si la mission a déjà été réussie) +.RE +.SS "Autres commandes" +.sp +Il y a quelques commandes supplémentaires donnant de l\(cqinformation sur le jeu\&. Mis à part la sous commande \fBindex\fR, elles ne sont pas particulièrement intéressantes pour le joueur\&. +.PP +\fBgsh index\fR +.RS 4 +affiche la liste des missions, avec leur statut +.RE +.PP +\fBgsh stat\fR [\fB\-v\fR] +.RS 4 +affiche des statistiques simples sur les missions effectuées +.RE +.PP +\fBgsh version\fR +.RS 4 +affiche la version de GameShell +.RE +.PP +\fBgsh welcome\fR +.RS 4 +affiche le message de bienvenue +.RE +.SS "Commandes pour le développeur" +.sp +Les commandes suivantes sont surtout intéressantes pour les développeurs de GameShell\&. Les joueurs ne devrait probablement pas les utiliser\&. +.PP +\fBgsh assert condition\fR [\fIMSG\fR] +.RS 4 +vérifie si la condition est vraie + +sinon, affiche un message d\(cqerreur +.RE +.PP +\fBgsh assert_check true/false\fR [\fIMSG\fR] +.RS 4 +vérifie si l\(cqobjectif de la mission en cours est atteint + +si le résultat ne correspond pas au résultat attendu, affiche un message d\(cqerreur +.RE +.PP +\fBgsh env\fR +.RS 4 +affiche les variables d\(cqenvironnement internes +.RE +.PP +\fBgsh hardreset\fR +.RS 4 +ré\-initialise la mission en cours en redémarrant le shell +.RE +.PP +\fBgsh HELP\fR +.RS 4 +affiche un message d\(cqaide complet, avec toutes les commandes Gameshell existantes +.RE +.PP +\fBgsh log\fR [\fB\-v\fR] +.RS 4 +affiche le fichier de log des commandes gsh +.RE +.PP +\fBgsh pcm\fR +.RS 4 +affiche le numéro de mission courant ("print current mission") +.RE +.PP +\fBgsh protect\fR et \fBgsh unprotect\fR +.RS 4 +ajoute / supprime les protections d\(cqaccès sur les répertoires de GameShell +.RE +.PP +\fBgsh resetstatic\fR +.RS 4 +re\-génère toutes les parties statique du monde +.RE +.PP +\fBgsh save\fR \fIFICHIER\fR +.RS 4 +sauve la partie actuelle dans le fichier +.RE +.PP +\fBgsh systemconfig\fR +.RS 4 +affiche la configuration du système +.RE +.PP +\fBgsh test\fR +.RS 4 +lance le script de test de la mission en cours, s\(cqil existe +.RE +.SH "AUTEURS" +.sp +GameShell a été initialement développé par Pierre Hyvernat et Rodolphe Lepigre à Université Savoie Mont Blanc, en partant d\(cqune idée dem Rodolphe Lepigre\&. Plusieurs autres personnes ont contribué des missions, des rapports de bug, des corrections de bugs et des traductions\&. +.sp +GameShell est actuellement maintenu par Pierre Hyvernat\&. +.SH "SIGNALER DES BOGUES" +.sp +Le meilleur moyen de signaler un bug est d\(cqouvrir un ticket sur github : https://github\&.com/phyver/GameShell/issues +.sp +Vous pouvez également envoyer un email directement à \&. +.sp +Merci d\(cqinclure +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +une description du problème, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +la version de GameShell que vous utilisez (cf +\fBgsh version\fR, ou l\(cqoption +\fB\-V\fR +du script GameShell), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +le résultat de la commande +\fBgsh env\fR, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +toute information pertinente supplémentaire\&. +.RE +.SH "VOIR AUSSI" +.sp +\fIbash\fR(1), \fIzsh\fR(1), \fIsh\fR(1), \fIgameshell\&.sh\fR(1) +.SH "GAMESHELL" +.sp +Les sources de GameShell sont hébergées sur github: https://github\&.com/phyver/GameShell +.SH "LICENCE" +.sp +GNU General Public Licence version 3, "GPLV3", https://www\&.gnu\&.org/licenses/gpl\-3\&.0\&.html diff --git a/i18n/source/gsh-commands/fr.full_help b/i18n/source/gsh-commands/fr.full_help new file mode 100644 index 000000000..20086610d --- /dev/null +++ b/i18n/source/gsh-commands/fr.full_help @@ -0,0 +1,105 @@ +Liste de toutes les commandes GameShell +======================================= + +Cette liste devrait être accessible dans une page de manuel UNIX : + + man gsh + + +Commandes pour le joueur +------------------------ + +gsh check + vérifie que l'objectif de la mission en cours est atteint + +gsh exit + quitte (et sauvegarde) la partie en cours + vous pouvez également quitter avec Contrôle-d + +gsh goal [N] + affiche l'objectif de la mission en cours + si N est donné, affiche l'objectif de la mission N + +gsh help + affiche un petit message d'aide + +gsh reset + ré-initialise la mission en cours + + +Commandes d'administration +-------------------------- + +gsh auto + lance le script automatique de la mission en cours, s'il existe. + +gsh goto [N] + passe directement à la mission N + (le mot de passe n'est pas nécessaire si N est une mission + précédente) + +gsh skip + abandonne la mission en cours et passe à la suivante + (le mot de passe n'est pas nécessaire si la mission a déjà été + réussie) + + + +Commandes supplémentaires +------------------------- + +gsh index + affiche la liste des missions, avec leur statut + +gsh stat [-v] + affiche des statistiques simples sur les missions effectuées + +gsh version + affiche la version de GameShell + +gsh welcome + affiche le message de bienvenue + + +Commandes pour les développeurs +------------------------------- + +gsh assert condition [MSG] + vérifie si la condition est vraie + sinon, affiche un message d'erreur + +gsh assert_check true/false [MSG] + vérifie si l'objectif de la mission en cours est atteint + si le résultat ne correspond pas au résultat attendu, affiche un + message d'erreur + +gsh env + affiche les variables d'environnement internes + +gsh hardreset + ré-initialise la mission en cours en redémarrant le shell + +gsh HELP + affiche un message d'aide complet, avec toutes les commandes Gameshell existantes + +gsh log [-v] + affiche le fichier de log des commandes gsh + +gsh pcm + affiche le numéro de mission courant ("print current mission") + +gsh protect et gsh unprotect + ajoute / supprime les protections d'accès sur les répertoires + de GameShell + +gsh resetstatic + re-génère toutes les parties statique du monde + +gsh save FICHIER + sauve la partie actuelle dans le fichier + +gsh systemconfig + affiche la configuration du système + +gsh test + lance le script de test de la mission en cours, s'il existe diff --git a/i18n/source/gsh-commands/fr.help b/i18n/source/gsh-commands/fr.help new file mode 100644 index 000000000..4dc4142b5 --- /dev/null +++ b/i18n/source/gsh-commands/fr.help @@ -0,0 +1,19 @@ +Commandes GameShell standard +============================ + +gsh check + vérifie que l'objectif de la mission en cours est atteint + +gsh exit + quitte (et sauvegarde) la partie en cours + vous pouvez également quitter avec Contrôle-d + +gsh goal [N] + affiche l'objectif de la mission en cours + si N est donné, affiche l'objectif de la mission N + +gsh help + affiche un petit message d'aide + +gsh reset + ré-initialise la mission en cours diff --git a/i18n/source/gsh-commands/fr/commands_admin.txt b/i18n/source/gsh-commands/fr/commands_admin.txt new file mode 100644 index 000000000..8823cdf1f --- /dev/null +++ b/i18n/source/gsh-commands/fr/commands_admin.txt @@ -0,0 +1,13 @@ +**gsh auto**:: + lance le script automatique de la mission en cours, s'il existe. + +**gsh goto** [__N__]:: + passe directement à la mission __N__ + + (le mot de passe n'est pas nécessaire si __N__ est une mission + précédente) + +**gsh skip**:: + abandonne la mission en cours et passe à la suivante + + (le mot de passe n'est pas nécessaire si la mission a déjà été + réussie) + diff --git a/i18n/source/gsh-commands/fr/commands_dev.txt b/i18n/source/gsh-commands/fr/commands_dev.txt new file mode 100644 index 000000000..049bc9813 --- /dev/null +++ b/i18n/source/gsh-commands/fr/commands_dev.txt @@ -0,0 +1,39 @@ +**gsh assert condition** [__MSG__]:: + vérifie si la condition est vraie + + sinon, affiche un message d'erreur + +**gsh assert_check true/false** [__MSG__]:: + vérifie si l'objectif de la mission en cours est atteint + + si le résultat ne correspond pas au résultat attendu, affiche un + message d'erreur + +**gsh env**:: + affiche les variables d'environnement internes + +**gsh hardreset**:: + ré-initialise la mission en cours en redémarrant le shell + +**gsh HELP**:: + affiche un message d'aide complet, avec toutes les commandes Gameshell existantes + +**gsh log** [**-v**]:: + affiche le fichier de log des commandes gsh + +**gsh pcm**:: + affiche le numéro de mission courant ("print current mission") + +**gsh protect** et **gsh unprotect**:: + ajoute / supprime les protections d'accès sur les répertoires + de GameShell + +**gsh resetstatic**:: + re-génère toutes les parties statique du monde + +**gsh save** __FICHIER__:: + sauve la partie actuelle dans le fichier + +**gsh systemconfig**:: + affiche la configuration du système + +**gsh test**:: + lance le script de test de la mission en cours, s'il existe diff --git a/i18n/source/gsh-commands/fr/commands_misc.txt b/i18n/source/gsh-commands/fr/commands_misc.txt new file mode 100644 index 000000000..ef87782e4 --- /dev/null +++ b/i18n/source/gsh-commands/fr/commands_misc.txt @@ -0,0 +1,11 @@ +**gsh index**:: + affiche la liste des missions, avec leur statut + +**gsh stat** [**-v**]:: + affiche des statistiques simples sur les missions effectuées + +**gsh version**:: + affiche la version de GameShell + +**gsh welcome**:: + affiche le message de bienvenue diff --git a/i18n/source/gsh-commands/fr/commands_standard.txt b/i18n/source/gsh-commands/fr/commands_standard.txt new file mode 100644 index 000000000..9f4a8a3ba --- /dev/null +++ b/i18n/source/gsh-commands/fr/commands_standard.txt @@ -0,0 +1,16 @@ +**gsh check**:: + vérifie que l'objectif de la mission en cours est atteint + +**gsh exit**:: + quitte (et sauvegarde) la partie en cours + + vous pouvez également quitter avec Contrôle-d + +**gsh goal** [__N__]:: + affiche l'objectif de la mission en cours + + si __N__ est donné, affiche l'objectif de la mission __N__ + +**gsh help**:: + affiche un petit message d'aide + +**gsh reset**:: + ré-initialise la mission en cours diff --git a/i18n/source/gsh-commands/fr/gsh_full_help.txt b/i18n/source/gsh-commands/fr/gsh_full_help.txt new file mode 100644 index 000000000..0056cf353 --- /dev/null +++ b/i18n/source/gsh-commands/fr/gsh_full_help.txt @@ -0,0 +1,30 @@ +Liste de toutes les commandes GameShell +======================================= + +Cette liste devrait être accessible dans une page de manuel UNIX : + + man gsh + + +Commandes pour le joueur +------------------------ + +INCLUDE fr/commands_standard.txt + + +Commandes d'administration +-------------------------- + +INCLUDE fr/commands_admin.txt + + +Commandes supplémentaires +------------------------- + +INCLUDE fr/commands_misc.txt + + +Commandes pour les développeurs +------------------------------- + +INCLUDE fr/commands_dev.txt diff --git a/i18n/source/gsh-commands/fr/gsh_help.txt b/i18n/source/gsh-commands/fr/gsh_help.txt new file mode 100644 index 000000000..8cdae144c --- /dev/null +++ b/i18n/source/gsh-commands/fr/gsh_help.txt @@ -0,0 +1,4 @@ +Commandes GameShell standard +============================ + +INCLUDE fr/commands_standard.txt diff --git a/i18n/source/gsh-commands/fr/man_gsh.txt b/i18n/source/gsh-commands/fr/man_gsh.txt new file mode 100644 index 000000000..b030c4311 --- /dev/null +++ b/i18n/source/gsh-commands/fr/man_gsh.txt @@ -0,0 +1,106 @@ +gsh(1) +====== + +NOM +--- +gsh - exécute les commandes spécifiques de GameShell + +SYNOPSIS +-------- +**gsh** <__COMMANDE__> + +DESCRIPTION +----------- +GameShell est un jeu pour apprendre (et enseigner) l'utilisation d'un shell +POSIX. + +Presque toutes les commandes rencontrées pendant une partie sont des commandes +Unix standard, à l'exception notable des commandes nécessaires pour interagir +avec GameShell lui même. Toutes ces commandes commencent par **gsh**, suivi +d'une sous-commande. + +NOTE +---- +Sur un système Unix standard, vous devriez pouvoir quitter ce manuel en +appuyant sur la touche "q". + +Vous devriez pouvoir faire défiler le texte avec la touche Espace ou les +flèches. + +Vous pouvez chercher dans le manuel en appuyant sur la touche "/", puis en +entrant le motif que vous recherchez. Un appui sur les touches "n" (pour +"next") ou "p" (pour "previous") déplacera le texte à l'occurrence suivante ou +précédente du motif. + +COMMANDES +--------- +Commandes standard pour le joueur +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Normalement, le joueur ne devrait pas avoir besoin d'autres +commandes que les suivantes. + +INCLUDE fr/commands_standard.txt + +Commandes pour l'administrateur +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Quelques commandes sont seulement utilisables si le joueurs connait le mot de +passe secret de GameShell. Ces commandes permettent par exemple de sauter une +mission fait partie. + +Le mot de passe par défaut est simplement "gsh" mais si vous utilisez +GameShell en classe, votre encadrant l'a probablement changé ! + +INCLUDE fr/commands_admin.txt + +Autres commandes +~~~~~~~~~~~~~~~~ +Il y a quelques commandes supplémentaires donnant de l'information sur le jeu. +Mis à part la sous commande **index**, elles ne sont pas particulièrement +intéressantes pour le joueur. + +INCLUDE fr/commands_misc.txt + +Commandes pour le développeur +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Les commandes suivantes sont surtout intéressantes pour les développeurs de +GameShell. Les joueurs ne devrait probablement pas les utiliser. + +INCLUDE fr/commands_dev.txt + +AUTEURS +------- +GameShell a été initialement développé par Pierre Hyvernat et Rodolphe Lepigre +à Université Savoie Mont Blanc, en partant d'une idée dem Rodolphe Lepigre. +Plusieurs autres personnes ont contribué des missions, des rapports de bug, +des corrections de bugs et des traductions. + +GameShell est actuellement maintenu par Pierre Hyvernat. + +SIGNALER DES BOGUES +------------------- +Le meilleur moyen de signaler un bug est d'ouvrir un ticket sur github : +https://github.com/phyver/GameShell/issues + +Vous pouvez également envoyer un email directement à +. + +Merci d'inclure + +* une description du problème, +* la version de GameShell que vous utilisez (cf **gsh version**, ou l'option **-V** + du script GameShell), +* le résultat de la commande **gsh env**, +* toute information pertinente supplémentaire. + + +VOIR AUSSI +---------- +__bash__(1), __zsh__(1), __sh__(1), __gameshell.sh__(1) + +GAMESHELL +--------- +Les sources de GameShell sont hébergées sur github: https://github.com/phyver/GameShell + +LICENCE +------- +GNU General Public Licence version 3, "GPLV3", https://www.gnu.org/licenses/gpl-3.0.html diff --git a/i18n/source/gsh-commands/it/commands_admin.txt b/i18n/source/gsh-commands/it/commands_admin.txt new file mode 100644 index 000000000..51cfa5e4a --- /dev/null +++ b/i18n/source/gsh-commands/it/commands_admin.txt @@ -0,0 +1,11 @@ +**gsh auto**:: + carica lo script della missione attuale, se esiste + +**gsh goto**:: [__N__] + vai direttamente alla missione __N__ + + (nessuna password necessaria se __N__ è la precedente) + +**gsh skip**:: + permette di saltare la missione e di passare alla successiva + + (nessuna password necessaria se la missione é stata completata + almeno una volta) diff --git a/i18n/source/gsh-commands/it/commands_dev.txt b/i18n/source/gsh-commands/it/commands_dev.txt new file mode 100644 index 000000000..24672133c --- /dev/null +++ b/i18n/source/gsh-commands/it/commands_dev.txt @@ -0,0 +1,38 @@ +**gsh assert condition** [__MSG__]:: + verifica se la condizione è vera + altrimenti mostra un messaggio di errore + +**gsh assert check true/false** [__MSG__]:: + verifica se gli obiettivi della missione corrente sono stati raggiunti + se il risultato non coincide con quello aspettato mostra un messaggio + di errore + +**gsh env**:: + mostra le variabili di sistema\environment + +**gsh hardreset**:: + reimposta la missione attuale riavviando la shell + +**gsh HELP**:: + questo messaggio + +**gsh log** [**-v**]:: + mostra lo storico dei comandi gsh + +**gsh pcm**:: + stampa il numero della missione attuale + +**gsh protect** e **gsh unprotect**:: + aggiunge / rimuove la protezione delle cartelle di GameShell + +**gsh resetstatic**:: + rigenera tutte le parti statiche del mondo di gioco + +**gsh save** __FILENAME__:: + salva la partita corrente su un file + +**gsh systemconfig**:: + mostra la configurazione del sistema + +**gsh test**:: + avvia i test della missione attuale, se esiste diff --git a/i18n/source/gsh-commands/it/commands_misc.txt b/i18n/source/gsh-commands/it/commands_misc.txt new file mode 100644 index 000000000..453f9c093 --- /dev/null +++ b/i18n/source/gsh-commands/it/commands_misc.txt @@ -0,0 +1,11 @@ +**gsh index**:: + mostra la lista delle missioni, con il loro status + +**gsh stat**:: + mostra statistiche semplici sulle missioni completate + +**gsh version**:: + mostra la versione di GameShell + +**gsh welcome**:: + mostra il messaggio di benvenuto diff --git a/i18n/source/gsh-commands/it/commands_standard.txt b/i18n/source/gsh-commands/it/commands_standard.txt new file mode 100644 index 000000000..6466e75c0 --- /dev/null +++ b/i18n/source/gsh-commands/it/commands_standard.txt @@ -0,0 +1,17 @@ +**gsh check**:: + verifica se gli obiettivi della missione attuale sono stati raggiunti + o no + +**gsh exit**:: + esci da GameShell + +**gsh goal** [__N__]:: + mostra gli obiettivi della missione + + se __N__ è fornito, mostra gli obiettivi della missione __N__ + +**gsh help**:: + messaggio di aiuto breve + +**gsh reset**:: + reimposta la missione attuale + diff --git a/i18n/source/gsh-commands/it/gsh_full_help.txt b/i18n/source/gsh-commands/it/gsh_full_help.txt new file mode 100644 index 000000000..cb2f6076e --- /dev/null +++ b/i18n/source/gsh-commands/it/gsh_full_help.txt @@ -0,0 +1,30 @@ +Full list of GameShell commands +=============================== + +This list of commands should also be available as a UNIX manual page: + + man gsh + + +Player commands +--------------- + +INCLUDE it/commands_standard.txt + + +Admin commands +-------------- + +INCLUDE it/commands_admin.txt + + +Additional commands +------------------- + +INCLUDE it/commands_misc.txt + + +Developpers commands +-------------------- + +INCLUDE it/commands_dev.txt diff --git a/i18n/source/gsh-commands/it/gsh_help.txt b/i18n/source/gsh-commands/it/gsh_help.txt new file mode 100644 index 000000000..0014fea3a --- /dev/null +++ b/i18n/source/gsh-commands/it/gsh_help.txt @@ -0,0 +1,4 @@ +Comandi specifici di GameShell +============================== + +INCLUDE it/commands_standard.txt diff --git a/i18n/source/gsh-commands/it/man_gsh.txt b/i18n/source/gsh-commands/it/man_gsh.txt new file mode 100644 index 000000000..b3b4059f2 --- /dev/null +++ b/i18n/source/gsh-commands/it/man_gsh.txt @@ -0,0 +1,101 @@ +gsh(1) +====== + +NAME +---- +gsh - GameShell specific commands invocation + +SYNOPSIS +-------- +**gsh** <__COMMAND__> + +DESCRIPTION +----------- +GameShell is a game for learning (and teaching) how to use a POSIX shell. + +Almost all the commands encountered during a game are standard Unix commands, +with the notable exception of the commands needed to interact with GameShell +itself. All those interaction start with **gsh**, followed by a subcommand. + +NOTE +---- +On standard Unix systems, you should be able to quit this manual by pressing +the "q" key. + +You should be able to scroll using the Space key or the arrow keys. + +You can search through this page by pressing on the "/" key, followed by the +pattern you are searching. Pressing "n" (for "next") or "p" (for "previous") +will go the next / previous occurrence of the search pattern. + +COMMANDS +-------- +Standard player commands +~~~~~~~~~~~~~~~~~~~~~~~~ +Under normal circumstances, a player shouldn't need to use more than the +following commands. + +INCLUDE it/commands_standard.txt + +Admin commands +~~~~~~~~~~~~~~ +Some commands are only accessible when the player knows the secret "GameShell +administrator password". Those commands make it possible to skip some mission. + +The password for the standard GameShell is simply "gsh" but if you're using +GameShell in the classroom, your instructor has probably changed it to +something else! + +INCLUDE it/commands_admin.txt + +Additional commands +~~~~~~~~~~~~~~~~~~~ +There are couple of additional commands that can give information about the +game. Except for the **index** subcommand, they aren't very interesting for +the player. + +INCLUDE it/commands_misc.txt + +Developer and administration commands +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The following commands are only useful for GameShell developers. Player +should probably avoid them. + +INCLUDE it/commands_dev.txt + +Authors +------- +GameShell was originally developed by Pierre Hyvernat and Rodolphe Lepigre at +Université Savoie Mont Blanc, based on an idea from Rodolphe Lepigre. Several +people have contributed individual missions, bug reports, bug fixes and +translations. + +It is currently maintained and developed by Pierre Hyvernat. + +Reporting Bugs +-------------- +The best way to report bug is by opening an issue on github: https://github.com/phyver/GameShell/issues + +You can also send an email directly to with a +description of your problem. + +Please include + +* a description of the problem +* the version of GameShell you are using (cf **gsh version**, or the **-V** + option of the GameShell script) +* the output of the **gsh env** command, +* any additional relevant information. + + +SEE ALSO +-------- +__bash__(1), __zsh__(1), __sh__(1), __gameshell.sh__(1) + +GAMESHELL +--------- +GameShell source code is hosted on github: https://github.com/phyver/GameShell + +LICENCE +------- +GNU General Public Licence version 3, "GPLV3", https://www.gnu.org/licenses/gpl-3.0.html diff --git a/i18n/source/include_files.awk b/i18n/source/include_files.awk new file mode 100755 index 000000000..2982d8e20 --- /dev/null +++ b/i18n/source/include_files.awk @@ -0,0 +1,16 @@ +#!/usr/bin/awk -f + +/INCLUDE/ { + filename = $2 + if ((getline < filename) < 0) { + print "ERROR: file", filename, "not found" > "/dev/stderr" ; + exit 1 + } + close(filename) + while (getline l < filename) { + print l + } + next +} + +{print} diff --git a/i18n/template.pot b/i18n/template.pot index 81f61ac3b..620c6cde4 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -1,9 +1,9 @@ #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-full-help/en.txt" +msgid "$GSH_ROOT/i18n/gsh-full-help/en.txt" msgstr "" #, sh-format -msgid "$GSH_ROOT/i18n/gameshell-help/en.txt" +msgid "$GSH_ROOT/i18n/gsh-help/en.txt" msgstr "" #, sh-format @@ -161,7 +161,7 @@ msgstr "" msgid "Error: you are not allowed to run this command." msgstr "" -msgid "Error: you shouldn't run Gameshell as root!" +msgid "Error: you shouldn't run GameShell as root!" msgstr "" msgid "Is this information correct? [Y/n]" @@ -195,7 +195,7 @@ msgid "The directory $GSH_CONFIG contains meta-data from a previous game.\n" "Do you want to remove it and start a new game? [y/N]" msgstr "" -msgid "The latest version of Gameshell is available at" +msgid "The latest version of GameShell is available at" msgstr "" msgid "There are stopped jobs in your session.\n" diff --git a/lib/gsh.sh b/lib/gsh.sh index 26e803c76..faf30ae62 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -642,11 +642,11 @@ _gsh_test() { # don't put the next 2 functions in $GSH_ROOT/scripts/_gsh_help / _gsh_HELP # because it doesn't work on case insensitive filesystems _gsh_help() { - parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-help/en.txt')" Parchment2 | pager + parchment "$(eval_gettext '$GSH_ROOT/i18n/gsh-help/en.txt')" Parchment2 | pager } _gsh_HELP() { - parchment "$(eval_gettext '$GSH_ROOT/i18n/gameshell-full-help/en.txt')" Parchment2 | pager + parchment "$(eval_gettext '$GSH_ROOT/i18n/gsh-full-help/en.txt')" Parchment2 | pager } gsh() { diff --git a/lib/header.sh b/lib/header.sh index c3f5da4e9..ebd4f8eb1 100644 --- a/lib/header.sh +++ b/lib/header.sh @@ -40,7 +40,7 @@ while getopts ":hHIndDM:CRXUVqL:KBZc:FS:" opt do case "$opt" in V) - echo "Gameshell $GSH_VERSION" + echo "GameShell $GSH_VERSION" if [ -n "$GSH_LAST_CHECKED_MISSION" ] then echo "saved game: [mission $GSH_LAST_CHECKED_MISSION] OK" diff --git a/man/README b/man/README new file mode 100644 index 000000000..99fc25fe1 --- /dev/null +++ b/man/README @@ -0,0 +1,2 @@ +DO NOT EDIT THOSE FILES DIRECTLY, THEY ARE GENERATED FROM THE FILES IN + ../i18n/source/gsh-commands diff --git a/man/fr/man1/gsh.1 b/man/fr/man1/gsh.1 new file mode 100644 index 000000000..83a62201b --- /dev/null +++ b/man/fr/man1/gsh.1 @@ -0,0 +1,267 @@ +'\" t +.\" Title: gsh +.\" Author: [FIXME: author] [see http://www.docbook.org/tdg5/en/html/author] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 12/10/2024 +.\" Manual: \ \& +.\" Source: \ \& +.\" Language: English +.\" +.TH "GSH" "1" "12/10/2024" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gsh \- appelle les commandes spécifiques de GameShell +.SH "SYNOPSIS" +.sp +\fBgsh\fR <\fICOMMANDE\fR> +.SH "DESCRIPTION" +.sp +GameShell est un jeu pour apprendre (et enseigner) l\(cqutilisation d\(cqun shell POSIX\&. +.sp +Presque toutes les commandes rencontrées pendant une partie sont des commandes Unix standard, à l\(cqexception notable des commandes nécessaires pour interagir avec GameShell lui même\&. Toutes ces commandes commencent par \fBgsh\fR, suivi d\(cqune sous\-commande\&. +.SH "NOTE" +.sp +Sur un système Unix standard, vous devriez pouvoir quitter ce manuel en appuyant sur la touche "q"\&. +.sp +Vous devriez pouvoir faire défiler le texte avec la touche Espace ou les flèches\&. +.sp +Vous pouvez chercher dans le manuel en appuyant sur la touche "/", puis en entrant le motif que vous recherchez\&. Un appui sur les touches "n" (pour "next") ou "p" (pour "previous") déplacera le texte à l\(cqoccurrence suivante ou précédente du motif\&. +.SH "COMMANDES" +.SS "Commandes standard pour le joueur" +.sp +En condition normales, le joueur ne devrait pas avoir besoin d\(cqautres commandes que les suivantes\&. +.PP +\fBgsh check\fR +.RS 4 +vérifie que l\(cqobjectif de la mission en cours est atteint +.RE +.PP +\fBgsh exit\fR +.RS 4 +quitte (et sauvegarde) la partie en cours + +vous pouvez également quitter avec Contrôle\-d +.RE +.PP +\fBgsh goal\fR [\fIN\fR] +.RS 4 +affiche l\(cqobjectif de la mission en cours + +si +\fIN\fR +est donné, affiche l\(cqobjectif de la mission +\fIN\fR +.RE +.PP +\fBgsh help\fR +.RS 4 +affiche un petit message d\(cqaide +.RE +.PP +\fBgsh reset\fR +.RS 4 +ré\-initialise la mission en cours +.RE +.SS "Commandes pour l\(cqadministrateur" +.sp +Quelques commandes sont seulement utilisables si le joueurs connait le mot de passe secret de GameShell\&. La commande qui permet de sauter une mission en fait partie\&. +.sp +Le mot de passe par défaut est simplement "gsh" mais si vous utilisez GameShell en classe, votre encadrant l\(cqa probablement changé ! +.PP +\fBgsh auto\fR +.RS 4 +lance le script automatique de la mission en cours, s\(cqil existe\&. +.RE +.PP +\fBgsh goto\fR [\fIN\fR] +.RS 4 +passe directement à la mission +\fIN\fR +(le mot de passe n\(cqest pas nécessaire si +\fIN\fR +est une mission précédente) +.RE +.PP +\fBgsh skip\fR +.RS 4 +abandonne la mission en cours et passe à la suivante + +(le mot de passe n\(cqest pas nécessaire si la mission a déjà été réussie) +.RE +.SS "Autres commandes" +.sp +Il y a quelques commandes supplémentaires donnant de l\(cqinformation sur le jeu\&. Mis à part la sous commande \fBindex\fR, elles ne sont pas particulièrement intéressantes pour le joueur\&. +.PP +\fBgsh index\fR +.RS 4 +affiche la liste des missions, avec leur statut +.RE +.PP +\fBgsh stat\fR [\fB\-v\fR] +.RS 4 +affiche des statistiques simples sur les missions effectuées +.RE +.PP +\fBgsh version\fR +.RS 4 +affiche la version de GameShell +.RE +.PP +\fBgsh welcome\fR +.RS 4 +affiche le message de bienvenue +.RE +.SS "Commandes pour le développeur" +.sp +Les commandes suivantes sont surtout intéressantes pour les développeurs de GameShell\&. Les joueurs ne devrait probablement pas les utiliser\&. +.PP +\fBgsh assert condition\fR [\fIMSG\fR] +.RS 4 +vérifie si la condition est vraie + +sinon, affiche un message d\(cqerreur +.RE +.PP +\fBgsh assert_check true/false\fR [\fIMSG\fR] +.RS 4 +vérifie si l\(cqobjectif de la mission en cours est atteint + +si le résultat ne correspond pas au résultat attendu, affiche un message d\(cqerreur +.RE +.PP +\fBgsh env\fR +.RS 4 +affiche les variables d\(cqenvironnement internes +.RE +.PP +\fBgsh hardreset\fR +.RS 4 +ré\-initialise la mission en cours en redémarrant le shell +.RE +.PP +\fBgsh HELP\fR +.RS 4 +affiche ce message +.RE +.PP +\fBgsh log\fR [\fB\-v\fR] +.RS 4 +affiche le fichier de log des commandes gsh +.RE +.PP +\fBgsh pcm\fR +.RS 4 +affiche le numéro de mission courant ("print current mission") +.RE +.PP +\fBgsh protect\fR et \fBgsh unprotect\fR +.RS 4 +ajoute / supprime les protections d\(cqaccès sur les répertoires de GameShell +.RE +.PP +\fBgsh resetstatic\fR +.RS 4 +re\-génère toutes les parties statique du monde +.RE +.PP +\fBgsh save\fR \fIFICHIER\fR +.RS 4 +sauve la partie actuelle dans le fichier +.RE +.PP +\fBgsh systemconfig\fR +.RS 4 +affiche la configuration du système +.RE +.PP +\fBgsh test\fR +.RS 4 +lance le script de test de la mission en cours, s\(cqil existe +.RE +.SH "AUTEURS" +.sp +GameShell a été initialement développé par Pierre Hyvernat et Rodolphe Lepigre à Université Savoie Mont Blanc, en partant d\(cqune idée dem Rodolphe Lepigre\&. Plusieurs autres personnes ont contribué des missions, des rapports de bug, des corrections de bugs et des traductions\&. +.sp +GameShell est actuellement maintenu par Pierre Hyvernat\&. +.SH "SIGNALER DES BOGUES" +.sp +Le meilleur moyen de signaler un bug est d\(cqouvrir un ticket sur github : https://github\&.com/phyver/GameShell/issues +.sp +Vous pouvez également envoyer un email directement à \&. +.sp +Merci d\(cqinclure +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +une description du problème, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +la version de GameShell que vous utilisez (cf +\fBgsh version\fR, ou l\(cqoption +\fB\-V\fR +du script GameShell), +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +le résultat de la commande +\fBgsh env\fR, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +toute information pertinente supplémentaire\&. +.RE +.SH "VOIR AUSSI" +.sp +\fIbash\fR(1), \fIzsh\fR(1), \fIsh\fR(1), \fIgameshell\&.sh\fR(1) +.SH "GAMESHELL" +.sp +Les sources de GameShell sont hébergées sur github: https://github\&.com/phyver/GameShell +.SH "LICENCE" +.sp +GNU General Public Licence version 3, "GPLV3", https://www\&.gnu\&.org/licenses/gpl\-3\&.0\&.html diff --git a/man/man1/gsh.1 b/man/man1/gsh.1 new file mode 100644 index 000000000..424b39325 --- /dev/null +++ b/man/man1/gsh.1 @@ -0,0 +1,268 @@ +'\" t +.\" Title: gsh +.\" Author: [see the "Authors" section] +.\" Generator: DocBook XSL Stylesheets vsnapshot +.\" Date: 12/10/2024 +.\" Manual: \ \& +.\" Source: \ \& +.\" Language: English +.\" +.TH "GSH" "1" "12/10/2024" "\ \&" "\ \&" +.\" ----------------------------------------------------------------- +.\" * Define some portability stuff +.\" ----------------------------------------------------------------- +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.\" http://bugs.debian.org/507673 +.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html +.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" ----------------------------------------------------------------- +.\" * set default formatting +.\" ----------------------------------------------------------------- +.\" disable hyphenation +.nh +.\" disable justification (adjust text to left margin only) +.ad l +.\" ----------------------------------------------------------------- +.\" * MAIN CONTENT STARTS HERE * +.\" ----------------------------------------------------------------- +.SH "NAME" +gsh \- GameShell specific commands invocation +.SH "SYNOPSIS" +.sp +\fBgsh\fR <\fICOMMAND\fR> +.SH "DESCRIPTION" +.sp +GameShell is a game for learning (and teaching) how to use a POSIX shell\&. +.sp +Almost all the commands encountered during a game are standard Unix commands, with the notable exception of the commands needed to interact with GameShell itself\&. All those interaction start with \fBgsh\fR, followed by a subcommand\&. +.SH "NOTE" +.sp +On standard Unix systems, you should be able to quit this manual by pressing the "q" key\&. +.sp +You should be able to scroll using the Space key or the arrow keys\&. +.sp +You can search through this page by pressing on the "/" key, followed by the pattern you are searching\&. Pressing "n" (for "next") or "p" (for "previous") will go the next / previous occurrence of the search pattern\&. +.SH "COMMANDS" +.SS "Standard player commands" +.sp +Under normal circumstances, a player shouldn\(cqt need to use more than the following commands\&. +.PP +\fBgsh check\fR +.RS 4 +check whether the current mission\(cqs goal has been achieved or not +.RE +.PP +\fBgsh exit\fR +.RS 4 +quit GameShell + +Note that you can exit GameShell using Control\-d as well +.RE +.PP +\fBgsh goal\fR [\fIN\fR] +.RS 4 +show the current mission\(cqs goal + +if +\fIN\fR +is given, show the goal for mission +\fIN\fR +.RE +.PP +\fBgsh help\fR +.RS 4 +short help message +.RE +.PP +\fBgsh reset\fR +.RS 4 +reset the current mission +.RE +.SS "Admin commands" +.sp +Some commands are only accessible when the player knows the secret "GameShell administrator password"\&. Those commands make it possible to skip some mission\&. +.sp +The password for the standard GameShell is simply "gsh" but if you\(cqre using GameShell in the classroom, your instructor has probably changed it to something else! +.PP +\fBgsh auto\fR +.RS 4 +source the current mission\(cqs automatic script, if it exists +.RE +.PP +\fBgsh goto\fR [\fIN\fR] +.RS 4 +directly go to mission +\fIN\fR +(Note: no password necessary if +\fIN\fR +is a previous mission) +.RE +.PP +\fBgsh skip\fR +.RS 4 +give up on the current mission and go to the next one + +(no password necessary if the mission was completed at least once) +.RE +.SS "Additional commands" +.sp +There are couple of additional commands that can give information about the game\&. Except for the \fBindex\fR subcommand, they aren\(cqt very interesting for the player\&. +.PP +\fBgsh index\fR +.RS 4 +show list of missions, with their status +.RE +.PP +\fBgsh stat\fR +.RS 4 +display simple statistics about completed missions +.RE +.PP +\fBgsh version\fR +.RS 4 +show GameShell\(cqs version +.RE +.PP +\fBgsh welcome\fR +.RS 4 +show the welcome message +.RE +.SS "Developer and administration commands" +.sp +The following commands are only useful for GameShell developers\&. Player should probably avoid them\&. +.PP +\fBgsh assert condition\fR [\fIMSG\fR] +.RS 4 +check if the condition is true + +if not, display an error message +.RE +.PP +\fBgsh assert check true/false\fR [\fIMSG\fR] +.RS 4 +check the current mission\(cqs goal has been achieved + +if the result doesn\(cqt coincide with the expected result, display an error message +.RE +.PP +\fBgsh env\fR +.RS 4 +display internal environment variables +.RE +.PP +\fBgsh hardreset\fR +.RS 4 +reset the current mission by restarting the shell +.RE +.PP +\fBgsh HELP\fR +.RS 4 +this message +.RE +.PP +\fBgsh log\fR [\fB\-v\fR] +.RS 4 +show the log file of gsh commands +.RE +.PP +\fBgsh pcm\fR +.RS 4 +print the current mission number +.RE +.PP +\fBgsh protect\fR and \fBgsh unprotect\fR +.RS 4 +add / remove protection on GameShell directories +.RE +.PP +\fBgsh resetstatic\fR +.RS 4 +regenerate all the static parts of the world +.RE +.PP +\fBgsh save\fR \fIFILENAME\fR +.RS 4 +save the current game to file +.RE +.PP +\fBgsh systemconfig\fR +.RS 4 +display the system configuration +.RE +.PP +\fBgsh test\fR +.RS 4 +run the current mission\(cqs test script, if it exists +.RE +.SH "AUTHORS" +.sp +GameShell was originally developed by Pierre Hyvernat and Rodolphe Lepigre at Université Savoie Mont Blanc, based on an idea from Rodolphe Lepigre\&. Several people have contributed individual missions, bug reports, bug fixes and translations\&. +.sp +It is currently maintained and developed by Pierre Hyvernat\&. +.SH "REPORTING BUGS" +.sp +The best way to report bug is by opening an issue on github: https://github\&.com/phyver/GameShell/issues +.sp +You can also send an email directly to with a description of your problem\&. +.sp +Please include +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +a description of the problem +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +the version of GameShell you are using (cf +\fBgsh version\fR, or the +\fB\-V\fR +option of the GameShell script) +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +the output of the +\fBgsh env\fR +command, +.RE +.sp +.RS 4 +.ie n \{\ +\h'-04'\(bu\h'+03'\c +.\} +.el \{\ +.sp -1 +.IP \(bu 2.3 +.\} +any additional relevant information\&. +.RE +.SH "SEE ALSO" +.sp +\fIbash\fR(1), \fIzsh\fR(1), \fIsh\fR(1), \fIgameshell\&.sh\fR(1) +.SH "GAMESHELL" +.sp +GameShell source code is hosted on github: https://github\&.com/phyver/GameShell +.SH "LICENCE" +.sp +GNU General Public Licence version 3, "GPLV3", https://www\&.gnu\&.org/licenses/gpl\-3\&.0\&.html diff --git a/missions/default.idx b/missions/default.idx index 5fe59affd..9ab77e146 100644 --- a/missions/default.idx +++ b/missions/default.idx @@ -1,4 +1,4 @@ -# default Gameshell missions order +# default GameShell missions order basic/default.idx misc/01_cal_nostradamus diff --git a/scripts/_gsh_version b/scripts/_gsh_version index 6f6142394..9527d38c3 100755 --- a/scripts/_gsh_version +++ b/scripts/_gsh_version @@ -4,9 +4,9 @@ GSH_VERSION='developpment version' -echo "Gameshell $GSH_VERSION" +echo "GameShell $GSH_VERSION" echo -echo $(gettext "The latest version of Gameshell is available at") +echo $(gettext "The latest version of GameShell is available at") echo " https://github.com/phyver/GameShell" diff --git a/scripts/progress_bar b/scripts/progress_bar index b85d1e630..09159a98c 100755 --- a/scripts/progress_bar +++ b/scripts/progress_bar @@ -208,7 +208,7 @@ animation() { # NOTE: disabling echoing in terminal during animation doesn't always work in zsh! # running - # ./utils/archive.sh -a missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires; ./gameshell.sh -Dqc "gsh auto" + # ./utils/makeshell_archive.sh -a missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires; ./gameshell.sh -Dqc "gsh auto" # loops! # Removing the stty -echo / stty echo makes the problem go away. # I'm not sure what happens... diff --git a/start.sh b/start.sh index bc6638cdf..fee21fca9 100755 --- a/start.sh +++ b/start.sh @@ -164,7 +164,7 @@ shift $((OPTIND - 1)) if [ $(id -u) -eq 0 ] then - echo "$(gettext "Error: you shouldn't run Gameshell as root!")" >&2 + echo "$(gettext "Error: you shouldn't run GameShell as root!")" >&2 exit 1 fi diff --git a/utils/archive.sh b/utils/gameshell_archive.sh similarity index 93% rename from utils/archive.sh rename to utils/gameshell_archive.sh index 8443b33b6..bed47eee1 100755 --- a/utils/archive.sh +++ b/utils/gameshell_archive.sh @@ -163,7 +163,7 @@ mkdir "$TMP_DIR/$NAME" # copy source files # NOTE: macOS' cp doesn't have '--archive', and '-a' is not POSIX. # use POSIX options to make sure it is portable -cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$TMP_DIR/$NAME" +cp -RPp "$GSH_ROOT/start.sh" "$GSH_ROOT/scripts" "$GSH_ROOT/utils" "$GSH_ROOT/lib" "$GSH_ROOT/i18n" "$GSH_ROOT/man" "$TMP_DIR/$NAME" # generate default index file @@ -171,7 +171,7 @@ ALL_INDEX_FILES=default.idx mkdir "$TMP_DIR/$NAME/missions" if ! make_index "$@" > "$TMP_DIR/$NAME/missions/default.idx" then - echo "Error: archive.sh, couldn't make default.idx" + echo "Error: gameshell_archive.sh, couldn't make default.idx" # --system makes GameShell use the standard rm utility instead of the "safe" # rm implemented in scripts/rm rm --system -rf "$TMP_DIR" @@ -186,7 +186,7 @@ do ALL_INDEX_FILES="$ALL_INDEX_FILES:$(basename "$FILE")" if ! make_index "$FILE" > "$TMP_DIR/$NAME/missions/$(basename "$FILE")" then - echo "Error: archive.sh, couldn't make $(basename "$FILE")" + echo "Error: gameshell_archive.sh, couldn't make $(basename "$FILE")" # --system makes GameShell use the standard rm utility instead of the "safe" # rm implemented in scripts/rm rm --system -rf "$TMP_DIR" @@ -297,6 +297,22 @@ then fi done done + + # remove translated manual pages + find "$GSH_ROOT/man" -type d | while read -r dir + do + if [ "$(basename "$dir")" = "man1" ] || [ "$(basename "$dir")" = "man" ] + then + continue + fi + if ! keep_language "$dir" "$LANGUAGES" + then + # --system makes GameShell use the standard rm utility instead of the "safe" + # rm implemented in scripts/rm + printf "." + rm --system -rf "$dir" + fi + done echo fi @@ -366,6 +382,8 @@ echo "removing unnecessary files" [ "$KEEP_TEST" -ne 1 ] && find ./missions -name "test.sh" | xargs rm --system -f [ "$KEEP_AUTO" -ne 1 ] && find ./missions -name auto.sh | xargs rm --system -f rm --system -rf "$GSH_ROOT/utils/" + rm --system -rf "$GSH_ROOT/i18n/source/" + rm --system -f "$GSH_ROOT/man/README" "$GSH_ROOT/i18n/gameshell-*help/README" ) # change admin password From 62e66937767c30bca6e0f7179bd3488d0daf1330 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Fri, 21 Mar 2025 10:22:56 +0100 Subject: [PATCH 092/103] 05_background: more explicit goal many students don't read the error from gsh check, so I added the note to the goal as well --- missions/intermediate/05_background/goal/en.txt | 3 +++ missions/intermediate/05_background/goal/fr.txt | 3 +++ missions/intermediate/05_background/goal/it.txt | 3 +++ 3 files changed, 9 insertions(+) diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt index 0ddc87418..9169ce0fa 100644 --- a/missions/intermediate/05_background/goal/en.txt +++ b/missions/intermediate/05_background/goal/en.txt @@ -8,6 +8,9 @@ A single firework can be created with the magical word $command +NOTE: you need to make sure the pyrotechnician sees all the fireworks while he +is waiting. + Useful commands =============== diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt index 815bd95bb..929f3a7a4 100644 --- a/missions/intermediate/05_background/goal/fr.txt +++ b/missions/intermediate/05_background/goal/fr.txt @@ -8,6 +8,9 @@ Une fusée simple peut être lancée avec le mot magique $command +NOTE : vous devez vous débrouiller pour que l'artificier voie tous les feux +d'artifice pendant qu'il attend. + Commandes utiles ================ diff --git a/missions/intermediate/05_background/goal/it.txt b/missions/intermediate/05_background/goal/it.txt index f29f4e933..9f12b9d07 100644 --- a/missions/intermediate/05_background/goal/it.txt +++ b/missions/intermediate/05_background/goal/it.txt @@ -8,6 +8,9 @@ Un singolo fuoco d'artificio può essere acceso con: $command +NOTA: hai bisogno di verificare che il pirotecnico possa vedere tutti i fuochi +di artificio mentre aspetta. + Comandi utili =============== From a64f19011fa099d12afcefc8e3f825565e1ac4e7 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Mon, 26 May 2025 15:21:24 +0200 Subject: [PATCH 093/103] special error message when no gsh subcommand is given and fix typo in translation files --- i18n/en.po | 18 ++++++++++++------ i18n/fr.po | 18 ++++++++++++------ i18n/it.po | 16 +++++++++++----- i18n/template.pot | 13 ++++++++++--- lib/gsh.sh | 13 +++++++++++-- 5 files changed, 56 insertions(+), 22 deletions(-) diff --git a/i18n/en.po b/i18n/en.po index de9c25562..f9027a09e 100644 --- a/i18n/en.po +++ b/i18n/en.po @@ -128,6 +128,10 @@ msgstr "Error: mission $MISSION_NB doesn't have an auto script." msgid "Error: mission $MISSION_NB is cancelled because some dependencies are not met." msgstr "Error: mission $MISSION_NB is cancelled because some dependencies are not met." +#, sh-format +msgid "Error: no gsh command given." +msgstr "Error: no gsh command given." + msgid "Error: no mission was found!\n" "Aborting." msgstr "Error: no mission was found!\n" @@ -149,10 +153,8 @@ msgid "Error: this option is only available from an executable archive!" msgstr "Error: this option is only available from an executable archive!" #, sh-format -msgid "Error: unknown gsh command '$cmd'.\n" - "Use one of the following commands:" -msgstr "Error: unknown gsh command '$cmd'.\n" - "Use one of the following commands:" +msgid "Error: unknown gsh command '$cmd'." +msgstr "Error: unknown gsh command '$cmd'." #, sh-format msgid "Error: unknown shell '$SHELL'.\n" @@ -215,6 +217,10 @@ msgstr "There are stopped jobs in your session.\n" " $ jobs\n" "Do you still want to quit? [y/n]" +#, sh-format +msgid "Use one of the following commands:" +msgstr "Use one of the following commands:" + #, sh-format msgid "Warning: command line arguments are ignored when continuing a game ($args)" msgstr "Warning: command line arguments are ignored when continuing a game ($args)" @@ -313,8 +319,8 @@ msgid "password:" msgstr "password:" #, sh-format -msgid "progress was saved in $SAVEFILE" -msgstr "progress was saved in $SAVEFILE" +msgid "progress was saved in $GSH_SAVEFILE" +msgstr "progress was saved in $GSH_SAVEFILE" msgid "skipped" msgstr "skipped" diff --git a/i18n/fr.po b/i18n/fr.po index 7d26ca0f0..dcb09929c 100644 --- a/i18n/fr.po +++ b/i18n/fr.po @@ -132,6 +132,10 @@ msgstr "Erreur : la mission $MISSION_NB n'a pas de script automatique." msgid "Error: mission $MISSION_NB is cancelled because some dependencies are not met." msgstr "Erreur : la mission $MISSION_NB est annulée car des dépendances ne sont pas satisfaites." +#, sh-format +msgid "Error: no gsh command given." +msgstr "Erreur: aucune command gsh donnée." + msgid "Error: no mission was found!\n" "Aborting." msgstr "Erreur : aucune mission trouvée !\n" @@ -153,10 +157,8 @@ msgid "Error: this option is only available from an executable archive!" msgstr "Erreur : cette option n'est disponible que depuis une archive exécutable !" #, sh-format -msgid "Error: unknown gsh command '$cmd'.\n" - "Use one of the following commands:" -msgstr "Erreur : command gsh inconnue '$cmd'.\n" - "Utilisez une des commandes suivantes :" +msgid "Error: unknown gsh command '$cmd'." +msgstr "Erreur : command gsh inconnue '$cmd'." #, sh-format msgid "Error: unknown shell '$SHELL'.\n" @@ -220,6 +222,10 @@ msgstr "Il y a des processus stoppés dans votre session.\n" " $ jobs\n" "Êtes vous sûr de vouloir quitter ? [o/N]" +#, sh-format +msgid "Use one of the following commands:" +msgstr "Utilisez une des commandes suivantes :" + #, sh-format msgid "Warning: command line arguments are ignored when continuing a game ($args)" msgstr "Warning: les arguments sur la ligne de commande sont ignorés lorsqu'on reprend une partie ($args)" @@ -320,8 +326,8 @@ msgid "password:" msgstr "mot de passe :" #, sh-format -msgid "progress was saved in $SAVEFILE" -msgstr "la progression a été sauvée dans $SAVEFILE" +msgid "progress was saved in $GSH_SAVEFILE" +msgstr "la progression a été sauvée dans $GSH_SAVEFILE" msgid "skipped" msgstr "sautée" diff --git a/i18n/it.po b/i18n/it.po index bffb14dbd..fcd33660c 100644 --- a/i18n/it.po +++ b/i18n/it.po @@ -142,6 +142,10 @@ msgstr "Errore: missione $MISSION_NB non ha uno script automatico." msgid "Error: mission $MISSION_NB is cancelled because some dependencies are not met." msgstr "Errore: missione $MISSION_NB é stata annullata perché alcune dipendenze non sono state trovate." +#, sh-format +msgid "Error: no gsh command given." +msgstr "" + msgid "Error: no mission was found!\n" "Aborting." msgstr "Errore: nessuna missione trovata!\n" @@ -163,10 +167,8 @@ msgid "Error: this option is only available from an executable archive!" msgstr "Errore: questa opzione é disponibile solo da un archivio eseguibile!" #, sh-format -msgid "Error: unknown gsh command '$cmd'.\n" - "Use one of the following commands:" -msgstr "Errore: comando gsh sconosciuto '$cmd@.\n" - "Usa uno dei comandi seguenti:" +msgid "Error: unknown gsh command '$cmd'." +msgstr "Errore: comando gsh sconosciuto '$cmd'." #, sh-format msgid "Error: unknown shell '$SHELL'.\n" @@ -230,6 +232,10 @@ msgstr "Ci sono dei processi fermati nella tua sessione.\n" "Vuoi uscire lo stesso? [s/n\n" "]" +#, sh-format +msgid "Use one of the following commands:" +msgstr "Usa uno dei comandi seguenti:" + #, sh-format msgid "Warning: command line arguments are ignored when continuing a game ($args)" msgstr "Attenzione: gli argomenti della linea di comando sono ignorati mentre si gioca ($args)" @@ -328,7 +334,7 @@ msgid "password:" msgstr "password:" #, sh-format -msgid "progress was saved in $SAVEFILE" +msgid "progress was saved in $GSH_SAVEFILE" msgstr "" msgid "skipped" diff --git a/i18n/template.pot b/i18n/template.pot index 620c6cde4..c69ba801c 100644 --- a/i18n/template.pot +++ b/i18n/template.pot @@ -126,6 +126,10 @@ msgstr "" msgid "Error: mission $MISSION_NB is cancelled because some dependencies are not met." msgstr "" +#, sh-format +msgid "Error: no gsh command given." +msgstr "" + msgid "Error: no mission was found!\n" "Aborting." msgstr "" @@ -146,8 +150,7 @@ msgid "Error: this option is only available from an executable archive!" msgstr "" #, sh-format -msgid "Error: unknown gsh command '$cmd'.\n" - "Use one of the following commands:" +msgid "Error: unknown gsh command '$cmd'." msgstr "" #, sh-format @@ -205,6 +208,10 @@ msgid "There are stopped jobs in your session.\n" "Do you still want to quit? [y/n]" msgstr "" +#, sh-format +msgid "Use one of the following commands:" +msgstr "" + #, sh-format msgid "Warning: command line arguments are ignored when continuing a game ($args)" msgstr "" @@ -296,7 +303,7 @@ msgid "password:" msgstr "" #, sh-format -msgid "progress was saved in $SAVEFILE" +msgid "progress was saved in $GSH_SAVEFILE" msgstr "" msgid "skipped" diff --git a/lib/gsh.sh b/lib/gsh.sh index faf30ae62..fe3144f51 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -653,6 +653,15 @@ gsh() { local _TEXTDOMAIN=$TEXTDOMAIN export TEXTDOMAIN="gsh" local cmd=$1 + + if [ -z "$cmd" ] + then + echo "$(eval_gettext "Error: no gsh command given.")" >&2 + echo "$(eval_gettext "Use one of the following commands:") check, goal, help, reset" >&2 + export TEXTDOMAIN=$_TEXTDOMAIN + unset _TEXTDOMAIN + return 1 + fi shift # should the command abort GameShell on failure (gsh test / gsh auto) @@ -742,8 +751,8 @@ gsh() { MISSION_NB=$MISSION_NB MISSION_DIR=$MISSION_DIR "_gsh_$cmd" "$@" ret=$? else - echo "$(eval_gettext "Error: unknown gsh command '\$cmd'. -Use one of the following commands:") check, goal, help, reset" >&2 + echo "$(eval_gettext "Error: unknown gsh command '\$cmd'.")" >&2 + echo "$(eval_gettext "Use one of the following commands:") check, goal, help, reset" >&2 export TEXTDOMAIN=$_TEXTDOMAIN unset _TEXTDOMAIN return 1 From 41609a29b8e78070bacb907038eb8e4bae9bc117 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 19 Jun 2025 13:33:03 +0200 Subject: [PATCH 094/103] some minor bugs to fix / improvment to implement --- missions/intermediate/05_background/test.sh | 7 +++++++ missions/pipe_intro_book_of_potions/04_pipe/check.sh | 3 +++ .../03_stdout_redirection_inventory/check.sh | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/missions/intermediate/05_background/test.sh b/missions/intermediate/05_background/test.sh index dc090d2a7..83c12251c 100644 --- a/missions/intermediate/05_background/test.sh +++ b/missions/intermediate/05_background/test.sh @@ -8,6 +8,13 @@ flarigo & flarigo & gsh assert check false flarigo & flarigo & flarigo & gsh assert check true flarigo & flarigo & flarigo & flarigo & gsh assert check true +# FIXME: those should work, but don't because the gsh assert check is run in a +# subshell... +# (they do work in a real game though) +# gsh assert check true & flarigo & flarigo & flarigo +# flarigo & gsh assert check true & flarigo & flarigo +# flarigo & flarigo & gsh assert check true & flarigo + flarigo & flarigo & flarigo gsh assert check false diff --git a/missions/pipe_intro_book_of_potions/04_pipe/check.sh b/missions/pipe_intro_book_of_potions/04_pipe/check.sh index 83100ca6a..64a8305e0 100644 --- a/missions/pipe_intro_book_of_potions/04_pipe/check.sh +++ b/missions/pipe_intro_book_of_potions/04_pipe/check.sh @@ -32,6 +32,9 @@ _mission_check() ( if [ "$res" != "$expected" ] then echo "$(gettext "Your previous command does not give the expected result...")" + # FIXME: if only the beginning of the recipe is shown, display a specific + # error message (if the player hasn't realized the recipe is on 2 pages, + # he won't understand why it didn't work) return 1 fi return 0 diff --git a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/check.sh b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/check.sh index ef64de5e7..c1cd7b703 100644 --- a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/check.sh +++ b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/check.sh @@ -14,6 +14,11 @@ _mission_check() ( sort "$office/$(gettext "Drawer")/$inventory_file" >"$temp_file" if ! cmp -s "$temp_file" "$GSH_TMP/inventory_grimoires" then + # FIXME: fail if inventory contains + # ./book... + # instead of + # book... + # display a specific message in that case echo "$(eval_gettext 'The content of $inventory_file is invalid. You can check its content with the command § less $inventory_file')" | sed 's/§/\$/' From d485bbe94c7ebee76c8f6659e7407f71ae79830a Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Thu, 19 Jun 2025 18:42:58 +0200 Subject: [PATCH 095/103] pass arguments to _gsh_check function --- lib/gsh.sh | 14 +++++--------- lib/mission_source.sh | 11 +++++++++-- missions/basic/01_cd_tower/test.sh | 10 +++++----- missions/basic/02_cd.._cellar/test.sh | 8 ++++---- missions/processes/03_pstree_kill/test.sh | 6 +++--- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/lib/gsh.sh b/lib/gsh.sh index fe3144f51..25a7aa2f0 100644 --- a/lib/gsh.sh +++ b/lib/gsh.sh @@ -373,7 +373,7 @@ _gsh_check() { local MISSION_DIR="$(missiondir "$MISSION_NB")" - mission_source "$MISSION_DIR/check.sh" + mission_source "$MISSION_DIR/check.sh" "$@" local exit_status=$? if [ "$exit_status" -eq 0 ] @@ -536,16 +536,16 @@ _gsh_assert_check() { local MISSION_NB="$(_gsh_pcm)" local expected=$1 + shift if [ "$expected" != "true" ] && [ "$expected" != "false" ] then echo "$(eval_gettext "Error: _gsh_assert_check only accept 'true' and 'false' as argument.")" >&2 return 1 fi - local msg=$3 local MISSION_DIR="$(missiondir "$MISSION_NB")" - mission_source "$MISSION_DIR/check.sh" + mission_source "$MISSION_DIR/check.sh" "$@" local exit_status=$? local nb_tests=$(cat "$GSH_TMP/nb_tests") @@ -558,13 +558,11 @@ _gsh_assert_check() { nb_failed_tests=$((nb_failed_tests+1)) echo "$nb_failed_tests" > "$GSH_TMP/nb_failed_tests" color_echo red "$(eval_gettext 'test $nb_tests failed') (expected check 'true')" - [ -n "$msg" ] && echo "$msg" elif [ "$expected" = "false" ] && [ "$exit_status" -eq 0 ] then nb_failed_tests=$((nb_failed_tests+1)) echo "$nb_failed_tests" > "$GSH_TMP/nb_failed_tests" color_echo red "$(eval_gettext 'test $nb_tests failed') (expected check 'false')" - [ -n "$msg" ] && echo "$msg" fi export GSH_LAST_ACTION="assert" @@ -575,13 +573,12 @@ _gsh_assert_check() { _gsh_assert() { local condition=$1 + shift if [ "$condition" = "check" ] then - shift _gsh_assert_check "$@" return fi - local msg=$2 local nb_tests=$(cat "$GSH_TMP/nb_tests") echo "$(( nb_tests + 1))" > "$GSH_TMP/nb_tests" @@ -590,7 +587,6 @@ _gsh_assert() { then echo "$(( nb_failed_tests + 1))" > "$GSH_TMP/nb_failed_tests" color_echo red "$(eval_gettext 'test $nb_tests failed') (expected condition 'true')" - [ -n "$msg" ] && echo "$msg" fi } @@ -674,7 +670,7 @@ gsh() { local ret=0 case $cmd in "check") - _gsh_check + _gsh_check "$@" ret=$? ;; "reset") diff --git a/lib/mission_source.sh b/lib/mission_source.sh index 8ea43c566..a062a2297 100644 --- a/lib/mission_source.sh +++ b/lib/mission_source.sh @@ -18,6 +18,7 @@ mission_source() { local FILENAME FILENAME=$1 + shift # keep the rest of the arguments to pass to the sourced file if ! [ -e "$FILENAME" ] then @@ -41,7 +42,7 @@ mission_source() { # if we are not running in DEBUG mode, just source the file if [ "$GSH_MODE" != "DEBUG" ] || [ -z "$GSH_VERBOSE_DEBUG" ] then - local _MISSION_DIR _TEXTDOMAIN _MISSION_NAME _PATH exit_status + local _MISSION_DIR _TEXTDOMAIN _MISSION_NAME _PATH _SAVED_ARGS exit_status export MISSION_DIR TEXTDOMAIN MISSION_NAME _MISSION_DIR=$MISSION_DIR MISSION_DIR=$(dirname "$(readlink-f "$FILENAME")") @@ -51,8 +52,11 @@ mission_source() { MISSION_NAME=${FILENAME#$GSH_MISSIONS/} _PATH=$PATH PATH=$PATH:$GSH_SBIN + _SAVED_ARGS="$@" + set -- "$@" # set $1 etc. . "$FILENAME" exit_status=$? + set -- $_SAVED_ARGS TEXTDOMAIN=$_TEXTDOMAIN MISSION_NAME=$_MISSION_NAME MISSION_DIR=$_MISSION_DIR @@ -61,7 +65,7 @@ mission_source() { return $exit_status fi - local _MISSION_DIR _TEXTDOMAIN _MISSION_NAME _PATH exit_status env_before env_after + local _MISSION_DIR _TEXTDOMAIN _MISSION_NAME _PATH _SAVED_ARGS exit_status env_before env_after export MISSION_DIR TEXTDOMAIN MISSION_NAME echo " GSH: sourcing \$GSH_ROOT/${FILENAME#$GSH_ROOT/}" >&2 _MISSION_DIR="" # otherwise, it appears in the environment! @@ -84,8 +88,11 @@ mission_source() { MISSION_NAME=${FILENAME#$GSH_MISSIONS/} _PATH=$PATH PATH=$PATH:$GSH_SBIN + _SAVED_ARGS="$@" + set -- "$@" # set $1 etc. . "$FILENAME" exit_status=$? + set -- $_SAVED_ARGS TEXTDOMAIN=$_TEXTDOMAIN MISSION_NAME=$_MISSION_NAME MISSION_DIR=$_MISSION_DIR diff --git a/missions/basic/01_cd_tower/test.sh b/missions/basic/01_cd_tower/test.sh index 628ba2c57..0b44dee4c 100644 --- a/missions/basic/01_cd_tower/test.sh +++ b/missions/basic/01_cd_tower/test.sh @@ -1,15 +1,15 @@ #!/usr/bin/env sh -gsh assert_check false +gsh assert check false cd .. -gsh assert_check false +gsh assert check false cd -gsh assert_check false +gsh assert check false cd "$(eval_gettext "\$GSH_HOME/Castle/Main_tower/First_floor/Second_floor/Top_of_the_tower")" -gsh assert_check true +gsh assert check true cd "$(eval_gettext "\$GSH_HOME/Castle/Main_tower/First_floor/Second_floor/Top_of_the_tower")/.." -gsh assert_check false +gsh assert check false diff --git a/missions/basic/02_cd.._cellar/test.sh b/missions/basic/02_cd.._cellar/test.sh index 1c35c7534..6f2c854b3 100644 --- a/missions/basic/02_cd.._cellar/test.sh +++ b/missions/basic/02_cd.._cellar/test.sh @@ -1,15 +1,15 @@ #!/usr/bin/env sh cd -gsh assert_check false +gsh assert check false cd "$(eval_gettext "\$GSH_HOME/Castle/Cellar")" -gsh assert_check true +gsh assert check true cd "$(eval_gettext "\$GSH_HOME/Castle/Cellar")/.." -gsh assert_check false +gsh assert check false cd -gsh assert_check false +gsh assert check false diff --git a/missions/processes/03_pstree_kill/test.sh b/missions/processes/03_pstree_kill/test.sh index ac521ebe7..ca5af7215 100644 --- a/missions/processes/03_pstree_kill/test.sh +++ b/missions/processes/03_pstree_kill/test.sh @@ -24,19 +24,19 @@ stand_by kill_imp_spell sleep 1 rm -f "$cellar"/*_"$(gettext "coal")" -gsh assert_check true +gsh assert check true stand_by kill_imp_spell sleep 1 -gsh assert_check false +gsh assert check false stand_by kill_imp_spell sleep 1 rm -f "$cellar"/*_"$(gettext "coal")" rm -f "$cellar"/*_"$(gettext "snowflake")" -gsh assert_check false +gsh assert check false unset -f kill_imp_spell From d9c206e8e7ec72f3fcaed6bf664c9fc8081f1059 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Sun, 1 Mar 2026 13:58:02 +0100 Subject: [PATCH 096/103] better hint for mission 19 --- missions/intermediate/05_background/goal/en.txt | 5 +++-- missions/intermediate/05_background/goal/fr.txt | 5 +++-- missions/intermediate/05_background/goal/it.txt | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/missions/intermediate/05_background/goal/en.txt b/missions/intermediate/05_background/goal/en.txt index 9169ce0fa..0a1264bd2 100644 --- a/missions/intermediate/05_background/goal/en.txt +++ b/missions/intermediate/05_background/goal/en.txt @@ -8,8 +8,9 @@ A single firework can be created with the magical word $command -NOTE: you need to make sure the pyrotechnician sees all the fireworks while he -is waiting. +NOTE: the pyrotechnician starts looking at the sky when you call the ``gsh +check`` command. Checking the mission after the fireworks have exploded will +not work. Useful commands diff --git a/missions/intermediate/05_background/goal/fr.txt b/missions/intermediate/05_background/goal/fr.txt index 929f3a7a4..3d9969e78 100644 --- a/missions/intermediate/05_background/goal/fr.txt +++ b/missions/intermediate/05_background/goal/fr.txt @@ -8,8 +8,9 @@ Une fusée simple peut être lancée avec le mot magique $command -NOTE : vous devez vous débrouiller pour que l'artificier voie tous les feux -d'artifice pendant qu'il attend. +NOTE : l'artificier commence à regarder le ciel lorsque vous lancez la +commande ``gsh check``. Vérifier la mission après l'explosion des feux +d'artifices ne marchera pas. Commandes utiles diff --git a/missions/intermediate/05_background/goal/it.txt b/missions/intermediate/05_background/goal/it.txt index 9f12b9d07..3c219aeb0 100644 --- a/missions/intermediate/05_background/goal/it.txt +++ b/missions/intermediate/05_background/goal/it.txt @@ -8,8 +8,9 @@ Un singolo fuoco d'artificio può essere acceso con: $command -NOTA: hai bisogno di verificare che il pirotecnico possa vedere tutti i fuochi -di artificio mentre aspetta. +NOTA: il pirotecnico inizia a guardare il cielo quando dai il comando ``gsh +check``. Controllare la missione dopo che i fuochi di artificio sono esplosi +non funzionerà. Comandi utili From 85663b2e003411e7c6fb61f9a9a0bed8c842a409 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Sun, 1 Mar 2026 14:04:42 +0100 Subject: [PATCH 097/103] gsh index parsed SKIP:AUTHFAILURE as SKIP it thus reported them as skipped --- scripts/_gsh_index | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/_gsh_index b/scripts/_gsh_index index b014c3159..0d01df511 100755 --- a/scripts/_gsh_index +++ b/scripts/_gsh_index @@ -17,19 +17,19 @@ do SKIPPABLE=" [$(gettext "optional")]" fi - if grep -q "^$n CHECK_OK" "$GSH_CONFIG/missions.log" + if grep -q "^$n CHECK_OK " "$GSH_CONFIG/missions.log" then COLOR="green" STATUS=" ($(gettext "completed"))" - elif grep -q "^$n CHECK_OOPS" "$GSH_CONFIG/missions.log" + elif grep -q "^$n CHECK_OOPS " "$GSH_CONFIG/missions.log" then COLOR="red" STATUS=" ($(gettext "failed"))" - elif grep -q "^$n SKIP" "$GSH_CONFIG/missions.log" + elif grep -q "^$n SKIP " "$GSH_CONFIG/missions.log" then COLOR="yellow" STATUS=" ($(gettext "skipped"))" - elif grep -q "^$n CANCEL_DEP_PB" "$GSH_CONFIG/missions.log" + elif grep -q "^$n CANCEL_DEP_PB " "$GSH_CONFIG/missions.log" then COLOR="magenta" STATUS=" ($(gettext "cancelled"))" From d3d1b3cf407def9f582261daa2803203f15ab8d0 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Sun, 1 Mar 2026 14:50:46 +0100 Subject: [PATCH 098/103] missing translation message --- .../04_stderr_dev-null_grimoires/i18n/en.po | 3 +++ .../04_stderr_dev-null_grimoires/i18n/fr.po | 3 +++ .../04_stderr_dev-null_grimoires/i18n/it.po | 3 +++ .../04_stderr_dev-null_grimoires/i18n/template.pot | 3 +++ 4 files changed, 12 insertions(+) diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/en.po b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/en.po index 49b6c64c5..bb210600a 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/en.po +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/en.po @@ -24,3 +24,6 @@ msgstr "Your previous command doesn't use the 'grep' command..." msgid "grimoire" msgstr "grimoire" + +msgid "Your command shouldn't generate error messages..." +msgstr "Your command shouldn't generate error messages..." diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/fr.po b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/fr.po index d6889f9b2..206abf582 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/fr.po +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/fr.po @@ -23,3 +23,6 @@ msgstr "Votre commande précédente n'utilise pas la commande 'grep'..." msgid "grimoire" msgstr "grimoire" + +msgid "Your command shouldn't generate error messages..." +msgstr "Votre commande ne devrait pas générer de messages d'erreur..." diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/it.po b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/it.po index babeb472d..b3865ac17 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/it.po +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/it.po @@ -23,3 +23,6 @@ msgstr "Il tuo comando precedente non utilizza il comando 'grep'..." msgid "grimoire" msgstr "grimorio" + +msgid "Your command shouldn't generate error messages..." +msgstr "" diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/template.pot b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/template.pot index dceaefb91..39b04d271 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/template.pot +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/i18n/template.pot @@ -23,3 +23,6 @@ msgstr "" msgid "grimoire" msgstr "" + +msgid "Your command shouldn't generate error messages..." +msgstr "" From 199ebee76a2cad9fbeae31071ba20b2ef6cdeb74 Mon Sep 17 00:00:00 2001 From: Pierre Hyvernat Date: Sun, 1 Mar 2026 14:53:16 +0100 Subject: [PATCH 099/103] remove --sort-output argument for gettext from ALL makefiles this option is deprecated and appears in every mission makefile --- Makefile | 2 +- missions/FINAL_MISSION/Makefile | 2 +- missions/basic/01_cd_tower/Makefile | 2 +- missions/basic/02_cd.._cellar/Makefile | 2 +- missions/basic/03_cd_HOME_throne/Makefile | 2 +- missions/basic/04_mkdir_chest/Makefile | 2 +- missions/basic/05_rm_spiders_cellar/Makefile | 2 +- missions/basic/06_mv_coins_garden/Makefile | 2 +- missions/basic/07_mv_hidden_coins_garden/Makefile | 2 +- missions/basic/08_rm_wildcard_spiders_cellar/Makefile | 2 +- missions/basic/09_rm_wildcard_hidden_spiders_cellar/Makefile | 2 +- missions/basic/10_cp_standard_great_hall/Makefile | 2 +- missions/basic/11_cp_wildcards_tapestries_great_hall/Makefile | 2 +- missions/basic/12_cp_ls_mtime_paintings_tower/Makefile | 2 +- missions/finding_files_maze/00_shared/Makefile | 2 +- missions/finding_files_maze/01_ls_cd/Makefile | 2 +- missions/finding_files_maze/02_tree/Makefile | 2 +- missions/finding_files_maze/03_find_1/Makefile | 2 +- missions/finding_files_maze/04_find_2/Makefile | 2 +- missions/finding_files_maze/05_find_xargs_grep/Makefile | 2 +- missions/intermediate/01_alias_la/Makefile | 2 +- missions/intermediate/02_alias_journal/Makefile | 2 +- missions/intermediate/03_tab_spider_lair/Makefile | 2 +- missions/intermediate/04_bg_xeyes/Makefile | 2 +- missions/intermediate/05_background/Makefile | 2 +- missions/intermediate/06_control-C/Makefile | 2 +- missions/misc/01_cal_nostradamus/Makefile | 2 +- missions/misc/02_nano_journal/Makefile | 2 +- missions/misc/03_tr_caesar_shift/Makefile | 2 +- missions/permissions/01_chmod_x_dir_king_quarter/Makefile | 2 +- missions/permissions/02_chmod_r_file_king_quarter/Makefile | 2 +- missions/permissions/03_chmod_rw_file_dir_throne_room/Makefile | 2 +- missions/pipe_intro_book_of_potions/00_shared/Makefile | 2 +- missions/pipe_intro_book_of_potions/01_head/Makefile | 2 +- missions/pipe_intro_book_of_potions/02_tail/Makefile | 2 +- missions/pipe_intro_book_of_potions/03_cat/Makefile | 2 +- missions/pipe_intro_book_of_potions/04_pipe/Makefile | 2 +- missions/pipe_intro_book_of_potions/05_pipe_head_tail/Makefile | 2 +- missions/pipes_merchant_stall/00_shared/Makefile | 2 +- missions/pipes_merchant_stall/01_pipe_1/Makefile | 2 +- missions/pipes_merchant_stall/02_pipe_2/Makefile | 2 +- missions/processes/01_ps_kill/Makefile | 2 +- missions/processes/02_ps_kill_signal/Makefile | 2 +- missions/processes/03_pstree_kill/Makefile | 2 +- missions/stdin_stdout_stderr/01_stdin_additions/Makefile | 2 +- .../02_stdin_redirection_multiplications/Makefile | 2 +- .../03_stdout_redirection_inventory/Makefile | 2 +- .../stdin_stdout_stderr/04_stderr_dev-null_grimoires/Makefile | 2 +- .../05_stdout_stderr_redirection_merlin/Makefile | 2 +- utils/new_mission.sh | 2 +- 50 files changed, 50 insertions(+), 50 deletions(-) diff --git a/Makefile b/Makefile index dde9f99bf..89a44be02 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ SH_FILES= start.sh scripts/* lib/gsh.sh lib/bashrc lib/zshrc lib/gshrc AWK_FILES=scripts/_gsh_stat.awk OTHER_FILES= -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/FINAL_MISSION/Makefile b/missions/FINAL_MISSION/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/FINAL_MISSION/Makefile +++ b/missions/FINAL_MISSION/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/01_cd_tower/Makefile b/missions/basic/01_cd_tower/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/01_cd_tower/Makefile +++ b/missions/basic/01_cd_tower/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/02_cd.._cellar/Makefile b/missions/basic/02_cd.._cellar/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/02_cd.._cellar/Makefile +++ b/missions/basic/02_cd.._cellar/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/03_cd_HOME_throne/Makefile b/missions/basic/03_cd_HOME_throne/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/03_cd_HOME_throne/Makefile +++ b/missions/basic/03_cd_HOME_throne/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/04_mkdir_chest/Makefile b/missions/basic/04_mkdir_chest/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/04_mkdir_chest/Makefile +++ b/missions/basic/04_mkdir_chest/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/05_rm_spiders_cellar/Makefile b/missions/basic/05_rm_spiders_cellar/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/05_rm_spiders_cellar/Makefile +++ b/missions/basic/05_rm_spiders_cellar/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/06_mv_coins_garden/Makefile b/missions/basic/06_mv_coins_garden/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/06_mv_coins_garden/Makefile +++ b/missions/basic/06_mv_coins_garden/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/07_mv_hidden_coins_garden/Makefile b/missions/basic/07_mv_hidden_coins_garden/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/07_mv_hidden_coins_garden/Makefile +++ b/missions/basic/07_mv_hidden_coins_garden/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/08_rm_wildcard_spiders_cellar/Makefile b/missions/basic/08_rm_wildcard_spiders_cellar/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/08_rm_wildcard_spiders_cellar/Makefile +++ b/missions/basic/08_rm_wildcard_spiders_cellar/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/09_rm_wildcard_hidden_spiders_cellar/Makefile b/missions/basic/09_rm_wildcard_hidden_spiders_cellar/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/09_rm_wildcard_hidden_spiders_cellar/Makefile +++ b/missions/basic/09_rm_wildcard_hidden_spiders_cellar/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/10_cp_standard_great_hall/Makefile b/missions/basic/10_cp_standard_great_hall/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/10_cp_standard_great_hall/Makefile +++ b/missions/basic/10_cp_standard_great_hall/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/11_cp_wildcards_tapestries_great_hall/Makefile b/missions/basic/11_cp_wildcards_tapestries_great_hall/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/11_cp_wildcards_tapestries_great_hall/Makefile +++ b/missions/basic/11_cp_wildcards_tapestries_great_hall/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/basic/12_cp_ls_mtime_paintings_tower/Makefile b/missions/basic/12_cp_ls_mtime_paintings_tower/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/basic/12_cp_ls_mtime_paintings_tower/Makefile +++ b/missions/basic/12_cp_ls_mtime_paintings_tower/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/00_shared/Makefile b/missions/finding_files_maze/00_shared/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/finding_files_maze/00_shared/Makefile +++ b/missions/finding_files_maze/00_shared/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/01_ls_cd/Makefile b/missions/finding_files_maze/01_ls_cd/Makefile index 856789c74..dc6fa0766 100644 --- a/missions/finding_files_maze/01_ls_cd/Makefile +++ b/missions/finding_files_maze/01_ls_cd/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/02_tree/Makefile b/missions/finding_files_maze/02_tree/Makefile index 856789c74..dc6fa0766 100644 --- a/missions/finding_files_maze/02_tree/Makefile +++ b/missions/finding_files_maze/02_tree/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/03_find_1/Makefile b/missions/finding_files_maze/03_find_1/Makefile index 856789c74..dc6fa0766 100644 --- a/missions/finding_files_maze/03_find_1/Makefile +++ b/missions/finding_files_maze/03_find_1/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/04_find_2/Makefile b/missions/finding_files_maze/04_find_2/Makefile index 856789c74..dc6fa0766 100644 --- a/missions/finding_files_maze/04_find_2/Makefile +++ b/missions/finding_files_maze/04_find_2/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/finding_files_maze/05_find_xargs_grep/Makefile b/missions/finding_files_maze/05_find_xargs_grep/Makefile index 856789c74..dc6fa0766 100644 --- a/missions/finding_files_maze/05_find_xargs_grep/Makefile +++ b/missions/finding_files_maze/05_find_xargs_grep/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/01_alias_la/Makefile b/missions/intermediate/01_alias_la/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/01_alias_la/Makefile +++ b/missions/intermediate/01_alias_la/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/02_alias_journal/Makefile b/missions/intermediate/02_alias_journal/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/02_alias_journal/Makefile +++ b/missions/intermediate/02_alias_journal/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/03_tab_spider_lair/Makefile b/missions/intermediate/03_tab_spider_lair/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/03_tab_spider_lair/Makefile +++ b/missions/intermediate/03_tab_spider_lair/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/04_bg_xeyes/Makefile b/missions/intermediate/04_bg_xeyes/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/04_bg_xeyes/Makefile +++ b/missions/intermediate/04_bg_xeyes/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/05_background/Makefile b/missions/intermediate/05_background/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/05_background/Makefile +++ b/missions/intermediate/05_background/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/intermediate/06_control-C/Makefile b/missions/intermediate/06_control-C/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/intermediate/06_control-C/Makefile +++ b/missions/intermediate/06_control-C/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/misc/01_cal_nostradamus/Makefile b/missions/misc/01_cal_nostradamus/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/misc/01_cal_nostradamus/Makefile +++ b/missions/misc/01_cal_nostradamus/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/misc/02_nano_journal/Makefile b/missions/misc/02_nano_journal/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/misc/02_nano_journal/Makefile +++ b/missions/misc/02_nano_journal/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/misc/03_tr_caesar_shift/Makefile b/missions/misc/03_tr_caesar_shift/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/misc/03_tr_caesar_shift/Makefile +++ b/missions/misc/03_tr_caesar_shift/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/permissions/01_chmod_x_dir_king_quarter/Makefile b/missions/permissions/01_chmod_x_dir_king_quarter/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/permissions/01_chmod_x_dir_king_quarter/Makefile +++ b/missions/permissions/01_chmod_x_dir_king_quarter/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/permissions/02_chmod_r_file_king_quarter/Makefile b/missions/permissions/02_chmod_r_file_king_quarter/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/permissions/02_chmod_r_file_king_quarter/Makefile +++ b/missions/permissions/02_chmod_r_file_king_quarter/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/permissions/03_chmod_rw_file_dir_throne_room/Makefile b/missions/permissions/03_chmod_rw_file_dir_throne_room/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/permissions/03_chmod_rw_file_dir_throne_room/Makefile +++ b/missions/permissions/03_chmod_rw_file_dir_throne_room/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/00_shared/Makefile b/missions/pipe_intro_book_of_potions/00_shared/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/pipe_intro_book_of_potions/00_shared/Makefile +++ b/missions/pipe_intro_book_of_potions/00_shared/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/01_head/Makefile b/missions/pipe_intro_book_of_potions/01_head/Makefile index ddfdbefd4..b61de9f7e 100644 --- a/missions/pipe_intro_book_of_potions/01_head/Makefile +++ b/missions/pipe_intro_book_of_potions/01_head/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/02_tail/Makefile b/missions/pipe_intro_book_of_potions/02_tail/Makefile index ddfdbefd4..b61de9f7e 100644 --- a/missions/pipe_intro_book_of_potions/02_tail/Makefile +++ b/missions/pipe_intro_book_of_potions/02_tail/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/03_cat/Makefile b/missions/pipe_intro_book_of_potions/03_cat/Makefile index ddfdbefd4..b61de9f7e 100644 --- a/missions/pipe_intro_book_of_potions/03_cat/Makefile +++ b/missions/pipe_intro_book_of_potions/03_cat/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/04_pipe/Makefile b/missions/pipe_intro_book_of_potions/04_pipe/Makefile index ddfdbefd4..b61de9f7e 100644 --- a/missions/pipe_intro_book_of_potions/04_pipe/Makefile +++ b/missions/pipe_intro_book_of_potions/04_pipe/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipe_intro_book_of_potions/05_pipe_head_tail/Makefile b/missions/pipe_intro_book_of_potions/05_pipe_head_tail/Makefile index ddfdbefd4..b61de9f7e 100644 --- a/missions/pipe_intro_book_of_potions/05_pipe_head_tail/Makefile +++ b/missions/pipe_intro_book_of_potions/05_pipe_head_tail/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipes_merchant_stall/00_shared/Makefile b/missions/pipes_merchant_stall/00_shared/Makefile index 62941fdf0..0d9385f79 100644 --- a/missions/pipes_merchant_stall/00_shared/Makefile +++ b/missions/pipes_merchant_stall/00_shared/Makefile @@ -5,7 +5,7 @@ OTHER_FILES=sbin/generate_merchant_stall.sh LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipes_merchant_stall/01_pipe_1/Makefile b/missions/pipes_merchant_stall/01_pipe_1/Makefile index 29bf18c90..03e7f4211 100644 --- a/missions/pipes_merchant_stall/01_pipe_1/Makefile +++ b/missions/pipes_merchant_stall/01_pipe_1/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/pipes_merchant_stall/02_pipe_2/Makefile b/missions/pipes_merchant_stall/02_pipe_2/Makefile index 29bf18c90..03e7f4211 100644 --- a/missions/pipes_merchant_stall/02_pipe_2/Makefile +++ b/missions/pipes_merchant_stall/02_pipe_2/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/processes/01_ps_kill/Makefile b/missions/processes/01_ps_kill/Makefile index dc49f3e0f..d773af71e 100644 --- a/missions/processes/01_ps_kill/Makefile +++ b/missions/processes/01_ps_kill/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/processes/02_ps_kill_signal/Makefile b/missions/processes/02_ps_kill_signal/Makefile index 83785bc85..860fb1d58 100644 --- a/missions/processes/02_ps_kill_signal/Makefile +++ b/missions/processes/02_ps_kill_signal/Makefile @@ -5,7 +5,7 @@ OTHER_FILES=spell.c LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/processes/03_pstree_kill/Makefile b/missions/processes/03_pstree_kill/Makefile index 8252da17f..1408c0e7f 100644 --- a/missions/processes/03_pstree_kill/Makefile +++ b/missions/processes/03_pstree_kill/Makefile @@ -5,7 +5,7 @@ OTHER_FILES=fairy/spell.sh imp/spell.sh LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/stdin_stdout_stderr/01_stdin_additions/Makefile b/missions/stdin_stdout_stderr/01_stdin_additions/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/stdin_stdout_stderr/01_stdin_additions/Makefile +++ b/missions/stdin_stdout_stderr/01_stdin_additions/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/Makefile b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/Makefile +++ b/missions/stdin_stdout_stderr/02_stdin_redirection_multiplications/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/Makefile b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/Makefile +++ b/missions/stdin_stdout_stderr/03_stdout_redirection_inventory/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/Makefile b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/Makefile index bd85007b1..2c0c50167 100644 --- a/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/Makefile +++ b/missions/stdin_stdout_stderr/04_stderr_dev-null_grimoires/Makefile @@ -5,7 +5,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/Makefile b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/Makefile index 5b0f5ae60..29fdbf8f2 100644 --- a/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/Makefile +++ b/missions/stdin_stdout_stderr/05_stdout_stderr_redirection_merlin/Makefile @@ -5,7 +5,7 @@ OTHER_FILES=merlin.c LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) diff --git a/utils/new_mission.sh b/utils/new_mission.sh index 439951c24..a04ee9de4 100755 --- a/utils/new_mission.sh +++ b/utils/new_mission.sh @@ -268,7 +268,7 @@ OTHER_FILES= LANGUAGES=$(wildcard i18n/*.po) LANGUAGES:=$(filter-out i18n/en.po, $(LANGUAGES)) SH_FILES:=$(filter-out $(EXCEPTIONS), $(SH_FILES)) -SORT=--sort-output +SORT= OPTIONS=--indent --no-wrap --no-location all: i18n/en.po $(LANGUAGES) From a29b3fa6704786fcf102aea939b58738a163180a Mon Sep 17 00:00:00 2001 From: PH Date: Tue, 3 Mar 2026 09:45:57 +0100 Subject: [PATCH 100/103] bug when cleaning mission 16 the real journal from the chest was removed on failure --- missions/intermediate/02_alias_journal/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/intermediate/02_alias_journal/check.sh b/missions/intermediate/02_alias_journal/check.sh index 96e32da38..42eebb7b2 100644 --- a/missions/intermediate/02_alias_journal/check.sh +++ b/missions/intermediate/02_alias_journal/check.sh @@ -31,8 +31,8 @@ _mission_check() { echo "$(eval_gettext "It seems you alias doesn't refer to the appropriate file (\$target_path). Make sure to use an absolute path...")" # save real journal.txt from the chest - find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf [ -f "$GSH_CHEST/journal.txt" ] && cp "$GSH_CHEST"/journal.txt "$GSH_TMP/journal.txt" + find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf [ -f "$GSH_TMP/journal.txt" ] && cp "$GSH_TMP"/journal.txt "$GSH_CHEST/journal.txt" return 1 fi From 5fa357e6cb2444adda473e530d8f7a0ca6176959 Mon Sep 17 00:00:00 2001 From: PH Date: Thu, 5 Mar 2026 11:41:53 +0100 Subject: [PATCH 101/103] note about not creating a directory for the first journal mission --- missions/misc/02_nano_journal/check.sh | 20 ++++-- missions/misc/02_nano_journal/goal/en.txt | 4 ++ missions/misc/02_nano_journal/goal/fr.txt | 5 +- missions/misc/02_nano_journal/i18n/en.po | 6 +- missions/misc/02_nano_journal/i18n/fr.po | 4 ++ missions/misc/02_nano_journal/i18n/it.po | 65 ++++++++++--------- .../misc/02_nano_journal/i18n/template.pot | 4 ++ missions/misc/02_nano_journal/test.sh | 3 + 8 files changed, 70 insertions(+), 41 deletions(-) diff --git a/missions/misc/02_nano_journal/check.sh b/missions/misc/02_nano_journal/check.sh index ee924d489..b06d50c1c 100644 --- a/missions/misc/02_nano_journal/check.sh +++ b/missions/misc/02_nano_journal/check.sh @@ -2,17 +2,23 @@ _mission_check() ( journal_file="$GSH_CHEST/$(gettext "journal").txt" - if [ ! -f "$journal_file" ] + if [ -d "$journal_file" ] then - journal=~${journal#$GSH_ROOT} - echo "$(eval_gettext "The file '\$journal_file' doesn't exist...")" - find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -f + journal=\~${journal_file#$GSH_ROOT} + echo "$(eval_gettext "'\$journal' is a directory!")" + find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf + return 1 + elif [ ! -f "$journal_file" ] + then + journal=\~${journal_file#$GSH_ROOT} + echo "$(eval_gettext "The file '\$journal' doesn't exist...")" + find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf return 1 elif [ ! -s "$journal_file" ] then - journal=~${journal#$GSH_ROOT} - echo "$(eval_gettext "The file '\$journal_file' is empty...")" - find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -f + journal=\~${journal_file#$GSH_ROOT} + echo "$(eval_gettext "The file '\$journal' is empty...")" + find "$GSH_HOME" -iname "*$(gettext "journal")*" -print0 | xargs -0 rm -rf return 1 else return 0 diff --git a/missions/misc/02_nano_journal/goal/en.txt b/missions/misc/02_nano_journal/goal/en.txt index fc38ed8cf..cb9c64eea 100644 --- a/missions/misc/02_nano_journal/goal/en.txt +++ b/missions/misc/02_nano_journal/goal/en.txt @@ -6,6 +6,10 @@ short message in it. You can use this file to record your notes and solutions for the upcoming missions. +Note that "journal.txt" is a file in the "Chest" directroy. You do not need +to create a new directory for this mission. + + Details ------- diff --git a/missions/misc/02_nano_journal/goal/fr.txt b/missions/misc/02_nano_journal/goal/fr.txt index cd0ddfb8b..cb562aa7b 100644 --- a/missions/misc/02_nano_journal/goal/fr.txt +++ b/missions/misc/02_nano_journal/goal/fr.txt @@ -1,11 +1,14 @@ Objectif ======== -Créez un fichier journal nommé 'journal.txt' dans votre coffre, et +Créez un fichier journal nommé "journal.txt" dans votre coffre, et inscrivez y un petit message. Vous pourrez utiliser ce fichier pour prendre des notes sur vos solutions lors des missions suivantes. +Attention, "journal.txt" est un fichier dans le répertoire "Coffre". Vous +n'avez pas besoin de créer de nouveau répertoire pour cette mission. + Détails ------- diff --git a/missions/misc/02_nano_journal/i18n/en.po b/missions/misc/02_nano_journal/i18n/en.po index 4101bcdbe..1aba1b735 100644 --- a/missions/misc/02_nano_journal/i18n/en.po +++ b/missions/misc/02_nano_journal/i18n/en.po @@ -1,6 +1,6 @@ # AUTOMATICALLY GENERATED -- DO NOT EDIT msgid "" -msgstr "Content-Type: text/plain; charset=UTF-8\n" +msgstr "Content-Type: text/plain; charset=ASCII\n" "Content-Transfer-Encoding: 8bit\n" #, sh-format @@ -35,3 +35,7 @@ msgstr "The file '$journal_file' is empty..." msgid "journal" msgstr "journal" + +#, sh-format +msgid "'$journal_file' is a directory!" +msgstr "'$journal_file' is a directory!" diff --git a/missions/misc/02_nano_journal/i18n/fr.po b/missions/misc/02_nano_journal/i18n/fr.po index 38f1142f1..015af8dd6 100644 --- a/missions/misc/02_nano_journal/i18n/fr.po +++ b/missions/misc/02_nano_journal/i18n/fr.po @@ -34,3 +34,7 @@ msgstr "Le fichier '$journal_file' est vide..." msgid "journal" msgstr "journal" + +#, sh-format +msgid "'$journal_file' is a directory!" +msgstr "'$journal_file' est un répertoire !" diff --git a/missions/misc/02_nano_journal/i18n/it.po b/missions/misc/02_nano_journal/i18n/it.po index a5acd0894..90bf2af4a 100644 --- a/missions/misc/02_nano_journal/i18n/it.po +++ b/missions/misc/02_nano_journal/i18n/it.po @@ -1,48 +1,49 @@ # mte90 , 2022. -msgid "" -msgstr "" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Last-Translator: mte90 \n" -"PO-Revision-Date: 2022-05-31 18:32+0200\n" -"Project-Id-Version: \n" -"Language-Team: Italian \n" -"Language: it_IT\n" -"MIME-Version: 1.0\n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" -"X-Generator: Lokalize 22.04.1\n" +msgid "" +msgstr "Project-Id-Version: \n" + "PO-Revision-Date: 2022-05-31 18:32+0200\n" + "Last-Translator: mte90 \n" + "Language-Team: Italian \n" + "Language: it_IT\n" + "MIME-Version: 1.0\n" + "Content-Type: text/plain; charset=UTF-8\n" + "Content-Transfer-Encoding: 8bit\n" + "Plural-Forms: nplurals=2; plural=(n != 1);\n" + "X-Generator: Lokalize 22.04.1\n" #, sh-format -msgid "$GSH_HOME/Forest/Hut/Chest" -msgstr "$GSH_HOME/Foresta/Capanna/Cassa" +msgid "$GSH_HOME/Forest/Hut/Chest" +msgstr "$GSH_HOME/Foresta/Capanna/Cassa" # path for the text file containing the goal -msgid "$MISSION_DIR/goal/en.txt" -msgstr "$MISSION_DIR/goal/it.txt" +msgid "$MISSION_DIR/goal/en.txt" +msgstr "$MISSION_DIR/goal/it.txt" # path for the text file containing the skip message -msgid "$MISSION_DIR/skip/en.txt" -msgstr "$MISSION_DIR/skip/it.txt" +msgid "$MISSION_DIR/skip/en.txt" +msgstr "$MISSION_DIR/skip/it.txt" # path for the text file containing the treasure message -msgid "$MISSION_DIR/treasure-msg/en.txt" -msgstr "$MISSION_DIR/treasure-msg/it.txt" +msgid "$MISSION_DIR/treasure-msg/en.txt" +msgstr "$MISSION_DIR/treasure-msg/it.txt" #, sh-format -msgid "" -"The command 'nano' is required for mission $MISSION_NAME.\n" -"(Debian / Ubuntu: install package 'nano')" -msgstr "" -"IL commando 'nano' é richiesto per la missione $MISSION_NAME.\n" -"(Debian / Ubuntu: installa il pacchetto 'nano')" +msgid "The command 'nano' is required for mission $MISSION_NAME.\n" + "(Debian / Ubuntu: install package 'nano')" +msgstr "IL commando 'nano' é richiesto per la missione $MISSION_NAME.\n" + "(Debian / Ubuntu: installa il pacchetto 'nano')" #, sh-format -msgid "The file '$journal_file' doesn't exist..." -msgstr "Il file '$journal_file' non esiste..." +msgid "The file '$journal_file' doesn't exist..." +msgstr "Il file '$journal_file' non esiste..." #, sh-format -msgid "The file '$journal_file' is empty..." -msgstr "Il file '$journail_file' é vuoto..." +msgid "The file '$journal_file' is empty..." +msgstr "Il file '$journail_file' é vuoto..." -msgid "journal" -msgstr "registro" +msgid "journal" +msgstr "registro" + +#, sh-format +msgid "'$journal_file' is a directory!" +msgstr "'$journail_file' è una cartella!" diff --git a/missions/misc/02_nano_journal/i18n/template.pot b/missions/misc/02_nano_journal/i18n/template.pot index 62a5c32d0..180eff40d 100644 --- a/missions/misc/02_nano_journal/i18n/template.pot +++ b/missions/misc/02_nano_journal/i18n/template.pot @@ -33,3 +33,7 @@ msgstr "" msgid "journal" msgstr "" + +#, sh-format +msgid "'$journal_file' is a directory!" +msgstr "" diff --git a/missions/misc/02_nano_journal/test.sh b/missions/misc/02_nano_journal/test.sh index a599c5a2d..5b0b06693 100644 --- a/missions/misc/02_nano_journal/test.sh +++ b/missions/misc/02_nano_journal/test.sh @@ -3,6 +3,9 @@ rm -f "$GSH_CHEST/$(gettext "journal").txt" gsh assert check false +mkdir "$GSH_CHEST/$(gettext "journal").txt" +gsh assert check false + touch "$GSH_CHEST/$(gettext "journal").txt" gsh assert check false From fa175bb26470ce79f9e4c2124e6afa6def52feb7 Mon Sep 17 00:00:00 2001 From: PH Date: Tue, 3 Mar 2026 10:49:44 +0100 Subject: [PATCH 102/103] bug in missionname function for some dummy missions a dummy mission might not contain check.sh, init.sh or static.sh, but only a gshrc file --- scripts/missionname | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/missionname b/scripts/missionname index c11cf1295..d0636ee4d 100755 --- a/scripts/missionname +++ b/scripts/missionname @@ -17,17 +17,17 @@ missionname() { cd "$path" fi + # look for the enclosing mission directory while true do [ -f check.sh ] && break [ -f static.sh ] && break [ -f init.sh ] && break + [ -f gshrc ] && break [ "$(pwd -P)" = "/" ] && break cd .. done - - case "$PWD" in "$GSH_MISSIONS/"*) path=$(pwd -P) From 53f470d70550c213f70b231eef102cef50d758ee Mon Sep 17 00:00:00 2001 From: Rodolphe Lepigre Date: Tue, 5 May 2026 20:59:49 +0200 Subject: [PATCH 103/103] Fix #183 (type in mission [misc/02_nano_journal]). --- missions/misc/02_nano_journal/goal/en.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/missions/misc/02_nano_journal/goal/en.txt b/missions/misc/02_nano_journal/goal/en.txt index cb9c64eea..e191ef56f 100644 --- a/missions/misc/02_nano_journal/goal/en.txt +++ b/missions/misc/02_nano_journal/goal/en.txt @@ -6,7 +6,7 @@ short message in it. You can use this file to record your notes and solutions for the upcoming missions. -Note that "journal.txt" is a file in the "Chest" directroy. You do not need +Note that "journal.txt" is a file in the "Chest" directory. You do not need to create a new directory for this mission.