Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --unsorted option to Retain Original Term Order #27

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bjorn-jurgenn
Copy link

There are valid cases where users may want to preserve the original order of terms as returned by the POEditor API. Currently poesie does not provide an option to retain this default behavior.

This PR introduces an optional -u/--unsorted flag that allows users to skip sorting the exported terms before saving them. By default, terms will continue to be sorted to maintain backward compatibility.

@niji-mathieu-viel
Copy link
Contributor

interesting feature! Just out of curiosity: did you pushed this MR because you noticed a new version after several years of inactivity? Or is it a pure coincidence?

@bjorn-jurgenn
Copy link
Author

interesting feature! Just out of curiosity: did you pushed this MR because you noticed a new version after several years of inactivity? Or is it a pure coincidence?

It was just a coincidence that we noticed that this feature is missing right after there was recent activity after a while. Not sure if I would put the MR if the was such an inactivity.

@@ -63,6 +63,9 @@ opts = OptionParser.new do |opts|
Poesie.exit_with_error("The provided substitutions file #{path} should only contain a (Array of) Hashes with String keys and values") unless valid
options[:substitutions] = subst
end
opts.on('-u', '--unsorted', %q(Disable alphabetical sorting of exported terms)) do
options[:unsorted] = true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would add the unsorted entry in the options definition above (with false as a default value); I know the code is technically working without this definition but all others options are mapped so I feel it would be useful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants