Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Sort zanata-cli-completion by option names
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Mar 2, 2015
1 parent 1e4413b commit fb21f72
Showing 1 changed file with 10 additions and 2 deletions.
Expand Up @@ -4,6 +4,7 @@
import java.io.IOException;
import java.lang.reflect.AccessibleObject;
import java.nio.charset.Charset;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Set;
Expand Down Expand Up @@ -40,8 +41,15 @@ public class BashCompletionGenerator {

private List<String> baseCommands;
private List<Option> genericOptions;
private Map<String, List<Option>> commandOptions = Maps.newHashMap();
private Set<Option> allOptions = Sets.newHashSet();

// by using TreeMap/TreeSet, we get consistent ordering in the generated files
private Map<String, List<Option>> commandOptions = Maps.newTreeMap();
private Set<Option> allOptions = Sets.newTreeSet(new Comparator<Option>() {
@Override
public int compare(Option o1, Option o2) {
return o1.name().compareTo(o2.name());
}
});
private String commandName;
private String commandDescription;

Expand Down

0 comments on commit fb21f72

Please sign in to comment.