commit fd1205528b6ad749cb55cf5bee4f2c7eabc1f116
parent 15d53d5109bcd09322e100f90662a550f4558f04
Author: lumidify <nobody@lumidify.org>
Date: Sat, 11 Apr 2020 16:42:45 +0200
Change nocompletechoices to be command line option
Diffstat:
1 file changed, 11 insertions(+), 14 deletions(-)
diff --git a/transliterate.pl b/transliterate.pl
@@ -413,7 +413,7 @@ sub prompt_choose_word {
@choices = sort {$choice_nums{$b} <=> $choice_nums{$a}} @choices;
}
# also give option to ignore word by just keeping everything
- push @choices, $word if !$config->{"nocompletechoices"};
+ push @choices, $word if !$args->{"nocompletechoices"};
foreach my $word_choice (@choices) {
my $button = Gtk2::Button->new($word_choice);
$button->signal_connect(
@@ -747,8 +747,7 @@ sub interpret_config {
"group" => [],
"endgroup" => [],
"retrywithout" => [$STRING],
- "targetdiacritics" => [$STRING],
- "nocompletechoices" => []
+ "targetdiacritics" => [$STRING]
);
my $in_group = 0;
foreach my $cmd (@$config_list) {
@@ -889,8 +888,6 @@ sub interpret_config {
$cmd_name eq "afterword" || $cmd_name eq "tablesep" ||
$cmd_name eq "choicesep" || $cmd_name eq "comment") {
$config{$cmd_name} = $cmd->[1]->{"value"};
- } elsif ($cmd_name eq "nocompletechoices") {
- $config{$cmd_name} = 1;
} elsif ($cmd_name eq "ignore") {
$config{"ignore"} = $cmd->[1]->{"value"};
my $table = load_ignore_table $cmd->[1]->{"value"}, $args;
@@ -1392,7 +1389,7 @@ GetOptions(
"force", "start=i",
"output=s", "config=s",
"errors=s", "help",
- "checkduplicates") or pod2usage(1);
+ "checkduplicates", "nocompletechoices") or pod2usage(1);
pod2usage(-exitval => 0, -verbose => 2) if $args{"help"};
pod2usage(-exitval => 1, -verbose => 1) if @ARGV > 1;
@@ -1520,6 +1517,13 @@ This can be used to "weed out" all the unknown words before
commencing the laborious task of choosing the right word every time
multiple options exist.
+=item B<--nocompletechoices>
+
+This disables showing the entire "word" (including B<choicesep>) in the
+L<word choice window|/"WORD CHOICE WINDOW">. This is useful if the text
+doesn't ever include B<choicesep> and the extra option just leads to
+careless mistakes.
+
=item B<--nounknowns>
Disables prompting for the right word when a word is not found in the database.
@@ -1594,7 +1598,7 @@ is possible to just press enter instead of manually clicking it. Before the
line is finalized, the user may press "Undo" to undo any changes on the
current line.
-Unless B<nocompletechoices> is specified in the config, the last option is
+Unless B<--nocompletechoices> is specified on the command line, the last option is
always the complete word (with B<choicesep>), in case it simply needs to
be ignored. I guess this could be useful if B<choicesep> occurs in the
text (although that should be avoided) and is ignored with a B<matchignore>
@@ -2043,13 +2047,6 @@ Historical note: This was called B<diacritics> in a previous version and only
allowed removal of diacritics. This is exactly the same functionality, just
generalized to allow removal of any characters with different buttons.
-=item B<nocompletechoices>
-
-This disables showing the entire "word" (including B<choicesep>) in the
-L<word choice window|/"WORD CHOICE WINDOW">. This is useful if the text
-doesn't ever include B<choicesep> and the extra option just leads to
-careless mistakes.
-
=item B<targetdiacritics> <diacritic> [...]
This was only added to simplify transliteration from Hindi to Urdu with the