| | |
| | | String format = "%-" + maxLength + "s %s"; |
| | | for (String name : Sets.newTreeSet(m.keySet())) { |
| | | final Class<? extends Command> c = m.get(name); |
| | | usage.append(" "); |
| | | CommandMetaData meta = c.getAnnotation(CommandMetaData.class); |
| | | if (meta != null) { |
| | | if (meta.hidden()) { |
| | | continue; |
| | | } |
| | | usage.append(" "); |
| | | usage.append(String.format(format, name, |
| | | Strings.nullToEmpty(meta.description()))); |
| | | } |
| | |
| | | d.setUploadPackFactory(gitblitUploadPackFactory); |
| | | d.setReceivePackFactory(gitblitReceivePackFactory); |
| | | d.setAuthenticator(authenticator); |
| | | } else if (cmd instanceof SetAccountCommand) { |
| | | SetAccountCommand setAccountCommand = (SetAccountCommand)cmd; |
| | | setAccountCommand.setAuthenticator(authenticator); |
| | | } else if (cmd instanceof BaseKeyCommand) { |
| | | BaseKeyCommand k = (BaseKeyCommand)cmd; |
| | | k.setAuthenticator(authenticator); |
| | | } |
| | | } |
| | | |