From 1aaa2f584122d547dd77547284d55f5458d447b6 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Mon, 8 Mar 2021 22:25:53 +0100 Subject: [PATCH] ruleup: dirty by default Replace the --dirty option with a new --clean option. Requested by Canik and Caedo at the Freeciv forum. See http://forum.freeciv.org/f/viewtopic.php?f=11&t=91862&sid=127735f2b4233e03427ccaf0429420f5 See osdn #41678 --- tests/rulesets_save.sh.in | 4 ++-- tools/ruleup.c | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/rulesets_save.sh.in b/tests/rulesets_save.sh.in index 4e7b7dd667..78a10e1bd1 100644 --- a/tests/rulesets_save.sh.in +++ b/tests/rulesets_save.sh.in @@ -38,7 +38,7 @@ for ruleset in $rulesets; do reresaved_path="${tmpdir}/${reresaved}" echo "Loading $ruleset and saving it as $resaved" - @abs_top_builddir@/fcruleup -F -r $ruleset \ + @abs_top_builddir@/fcruleup -F -c -r $ruleset \ --output "$resaved_path" \ || exit 1 @@ -50,7 +50,7 @@ for ruleset in $rulesets; do echo "Checking ruleset saving stability for $ruleset" echo "Resaving resaved $ruleset" - FREECIV_DATA_PATH=$tmpdir @abs_top_builddir@/fcruleup -r "$resaved" \ + FREECIV_DATA_PATH=$tmpdir @abs_top_builddir@/fcruleup -c -r "$resaved" \ --output "$reresaved_path" \ || exit 1 if [ ! -d "$reresaved_path" ] ; then diff --git a/tools/ruleup.c b/tools/ruleup.c index e1c7f47009..afd4152629 100644 --- a/tools/ruleup.c +++ b/tools/ruleup.c @@ -46,7 +46,7 @@ static char *rs_selected = NULL; static char *od_selected = NULL; static int fatal_assertions = -1; -static bool dirty = FALSE; +static bool dirty = TRUE; /**********************************************************************//** Parse freeciv-ruleup commandline parameters. @@ -77,8 +77,8 @@ static void rup_parse_cmdline(int argc, char *argv[]) /* TRANS: "output" is exactly what user must type, do not translate. */ _("output DIRECTORY"), _("Create directory DIRECTORY for output")); - cmdhelp_add(help, "d", "dirty", - _("Don't clean up the ruleset before saving it")); + cmdhelp_add(help, "c", "clean", + _("Clean up the ruleset before saving it.")); /* The function below prints a header and footer for the options. * Furthermore, the options are sorted. */ @@ -115,8 +115,8 @@ static void rup_parse_cmdline(int argc, char *argv[]) exit(EXIT_FAILURE); } #endif /* FREECIV_NDEBUG */ - } else if (is_option("--dirty", argv[i])) { - dirty = TRUE; + } else if (is_option("--clean", argv[i])) { + dirty = FALSE; } else { fc_fprintf(stderr, _("Unrecognized option: \"%s\"\n"), argv[i]); cmdline_option_values_free(); -- 2.20.1