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

docs: reorder command options #592

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion prepare-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ sed -i.bak -e 's/# Config Options/## Config Options/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]hidden\*\*/`--\[no-]hidden`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]duplicate-translations\*\*/`--[no-]duplicate-translations`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]translate-untranslated-only\*\*/`--[no-]translate-untranslated-only`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]translate-with-perfect-match-only\*\*/--[no-]translate-with-perfect-match-only/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]translate-with-perfect-match-only\*\*/`--[no-]translate-with-perfect-match-only`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]skip-assigned-strings\*\*/`--[no-]skip-assigned-strings`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]skip-untranslated-strings\*\*/`--[no-]skip-untranslated-strings`/g' -- *.md
sed -i.bak -e 's/\*\*--\[no-\]auto-update\*\*/`--[no-]auto-update`/g' -- *.md
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ class BranchAddSubcommand extends ActCommandProject {
@CommandLine.Parameters(descriptionKey = "crowdin.branch.add.name")
protected String name;

@CommandLine.Option(names = "--title", paramLabel = "...")
@CommandLine.Option(names = "--title", paramLabel = "...", order = -2)
protected String title;

@CommandLine.Option(names = "--export-pattern", paramLabel = "...")
@CommandLine.Option(names = "--export-pattern", paramLabel = "...", order = -2)
protected String exportPattern;

@CommandLine.Option(names = "--priority", paramLabel = "...")
@CommandLine.Option(names = "--priority", paramLabel = "...", order = -2)
protected Priority priority;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ class BundleAddSubcommand extends ActCommandBundle {
@CommandLine.Parameters(descriptionKey = "crowdin.bundle.add.name")
protected String name;

@CommandLine.Option(names = {"--format"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.format")
@CommandLine.Option(names = {"--format"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.format", order = -2)
protected String format;

@CommandLine.Option(names = {"--source"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.source")
@CommandLine.Option(names = {"--source"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.source", order = -2)
protected List<String> source;

@CommandLine.Option(names = {"--ignore"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.ignore")
@CommandLine.Option(names = {"--ignore"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.ignore", order = -2)
protected List<String> ignore;

@CommandLine.Option(names = {"--translation"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.translation")
@CommandLine.Option(names = {"--translation"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.translation", order = -2)
protected String translation;

@CommandLine.Option(names = {"--label"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.label")
@CommandLine.Option(names = {"--label"}, paramLabel = "...", descriptionKey = "crowdin.bundle.add.label", order = -2)
protected List<Long> labels;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
Expand Down Expand Up @@ -63,5 +63,4 @@ protected List<String> checkOptions() {
}
return errors;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,10 @@ public class DownloadSourcesSubcommand extends ActCommandWithFiles {
@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected boolean isAnsi() {
return super.isAnsi() && !plainView;
}

@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...")
@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...", order = -2)
protected String branchName;

@CommandLine.Option(names = {"--reviewed"}, descriptionKey = "params.reviewedSources")
@CommandLine.Option(names = {"--reviewed"}, descriptionKey = "params.reviewedSources", order = -2)
protected boolean reviewed;

@CommandLine.Option(names = {"--dryrun"})
Expand All @@ -35,4 +30,9 @@ protected boolean isAnsi() {
protected NewAction<PropertiesWithFiles, ProjectClient> getAction(Actions actions) {
return new DownloadSourcesAction(new FsFiles(), noProgress, plainView, branchName, debug, reviewed, dryrun);
}

@Override
protected boolean isAnsi() {
return super.isAnsi() && !plainView;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,49 +22,49 @@
)
class DownloadSubcommand extends ActCommandWithFiles {

@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...")
@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...", order = -2)
protected String branchName;

@CommandLine.Option(names = {"--ignore-match"})
@CommandLine.Option(names = {"--ignore-match"}, order = -2)
protected boolean ignoreMatch;

@CommandLine.Option(names = {"-l", "--language"}, paramLabel = "...")
@CommandLine.Option(names = {"-l", "--language"}, paramLabel = "...", order = -2)
protected List<String> languageIds;

@CommandLine.Option(names = {"--pseudo"}, descriptionKey = "crowdin.download.pseudo")
@CommandLine.Option(names = {"--pseudo"}, descriptionKey = "crowdin.download.pseudo", order = -2)
protected boolean pseudo;

@CommandLine.Option(names = {"--dryrun"})
protected boolean dryrun;

@CommandLine.Option(names = {"--tree"}, descriptionKey = "tree.dryrun")
protected boolean treeView;

@CommandLine.Option(names = {"--skip-untranslated-strings"}, descriptionKey = "params.skipUntranslatedStrings")
@CommandLine.Option(names = {"--skip-untranslated-strings"}, descriptionKey = "params.skipUntranslatedStrings", order = -2)
protected Boolean skipTranslatedOnly;

@CommandLine.Option(names = {"--skip-untranslated-files"}, descriptionKey = "params.skipUntranslatedFiles")
@CommandLine.Option(names = {"--skip-untranslated-files"}, descriptionKey = "params.skipUntranslatedFiles", order = -2)
protected Boolean skipUntranslatedFiles;

@CommandLine.Option(names = {"--export-only-approved"}, descriptionKey = "params.exportOnlyApproved")
@CommandLine.Option(names = {"--export-only-approved"}, descriptionKey = "params.exportOnlyApproved", order = -2)
protected Boolean exportApprovedOnly;

@CommandLine.Option(names = {"--keep-archive"}, descriptionKey = "params.keepArchive")
@CommandLine.Option(names = {"--keep-archive"}, descriptionKey = "params.keepArchive", order = -2)
protected boolean keepArchive;

@CommandLine.Option(names = {"--all"})
@CommandLine.Option(names = {"--all"}, order = -2)
protected boolean all;

@CommandLine.Option(names = {"--dryrun"})
protected boolean dryrun;

@CommandLine.Option(names = {"--tree"}, descriptionKey = "tree.dryrun")
protected boolean treeView;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected NewAction<PropertiesWithFiles, ProjectClient> getAction(Actions actions) {
return (dryrun)
? actions.listTranslations(noProgress, treeView, false, plainView, all, true)
: actions.download(new FsFiles(), noProgress, languageIds, pseudo, branchName, ignoreMatch, isVerbose, plainView, all, keepArchive);
}

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected boolean isAnsi() {
return super.isAnsi() && !plainView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,21 @@
import java.util.List;

@CommandLine.Command(
name = CommandNames.GLOSSARY_DOWNLOAD
name = CommandNames.GLOSSARY_DOWNLOAD,
sortOptions = false
)
class GlossaryDownloadSubcommand extends ActCommandGlossary {

@CommandLine.Option(names = {"--id"}, paramLabel = "...")
@CommandLine.Option(names = {"--id"}, paramLabel = "...", order = -2)
private Long id;

@CommandLine.Option(names = {"--name"}, paramLabel = "...")
@CommandLine.Option(names = {"--name"}, paramLabel = "...", order = -2)
private String name;

@CommandLine.Option(names = {"--format"}, paramLabel = "...")
@CommandLine.Option(names = {"--format"}, paramLabel = "...", order = -2)
private GlossariesFormat format;

@CommandLine.Option(names = "--to", paramLabel = "...")
@CommandLine.Option(names = "--to", paramLabel = "...", order = -2)
private File to;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,27 @@
import java.util.Map;

@CommandLine.Command(
name = CommandNames.GLOSSARY_UPLOAD
name = CommandNames.GLOSSARY_UPLOAD,
sortOptions = false
)
class GlossaryUploadSubcommand extends ActCommandGlossary {

@CommandLine.Parameters(descriptionKey = "crowdin.glossary.upload.file")
private File file;

@CommandLine.Option(names = {"--id"}, paramLabel = "...")
@CommandLine.Option(names = {"--id"}, paramLabel = "...", order = -2)
private Long id;

@CommandLine.Option(names = {"--name"}, paramLabel = "...")
@CommandLine.Option(names = {"--name"}, paramLabel = "...", order = -2)
private String name;

@CommandLine.Option(names = {"--language"}, paramLabel = "...", descriptionKey = "crowdin.glossary.upload.language-id")
@CommandLine.Option(names = {"--language"}, paramLabel = "...", descriptionKey = "crowdin.glossary.upload.language-id", order = -2)
private String languageId;

@CommandLine.Option(names = {"--scheme"}, paramLabel = "...")
@CommandLine.Option(names = {"--scheme"}, paramLabel = "...", order = -2)
private Map<String, Integer> scheme;

@CommandLine.Option(names = {"--first-line-contains-header"})
@CommandLine.Option(names = {"--first-line-contains-header"}, order = -2)
private Boolean firstLineContainsHeader;

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,24 @@
import picocli.CommandLine;

@CommandLine.Command(
name = CommandNames.LIST_LANGUAGES
name = CommandNames.LIST_LANGUAGES,
sortOptions = false
)
class ListLanguagesSubcommand extends ActCommandProject {

@CommandLine.Option(names = {"--code"}, paramLabel = "...")
@CommandLine.Option(names = {"--code"}, paramLabel = "...", order = -2)
protected BaseCli.LanguageCode code;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected NewAction<ProjectProperties, ProjectClient> getAction(Actions actions) {
return actions.listLanguages(code, noProgress, plainView);
}

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected final boolean isAnsi() {
return super.isAnsi() && !plainView;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,25 @@
import picocli.CommandLine;

@CommandLine.Command(
name = CommandNames.LIST_PROJECT)
name = CommandNames.LIST_PROJECT,
sortOptions = false
)
class ListProjectSubcommand extends ActCommandProject {

@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...")
@CommandLine.Option(names = {"-b", "--branch"}, paramLabel = "...", order = -2)
protected String branch;

@CommandLine.Option(names = {"--tree"})
@CommandLine.Option(names = {"--tree"}, order = -2)
protected boolean treeView;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected NewAction<ProjectProperties, ProjectClient> getAction(Actions actions) {
return actions.listProject(this.noProgress, this.branch, this.treeView, this.plainView);
}

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected final boolean isAnsi() {
return super.isAnsi() && !plainView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,25 @@
import picocli.CommandLine;

@CommandLine.Command(
name = CommandNames.LIST_SOURCES
name = CommandNames.LIST_SOURCES,
sortOptions = false
)
class ListSourcesSubcommand extends ActCommandWithFiles {

@CommandLine.Option(names = {"-b", "--branch"})
@CommandLine.Option(names = {"-b", "--branch"}, order = -2)
protected String branch;

@CommandLine.Option(names = {"--tree"})
@CommandLine.Option(names = {"--tree"}, order = -2)
protected boolean treeView;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected NewAction<PropertiesWithFiles, ProjectClient> getAction(Actions actions) {
return actions.listSources(false, null, this.noProgress, this.treeView, this.plainView);
}

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected final boolean isAnsi() {
return super.isAnsi() && !plainView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,22 @@
import picocli.CommandLine;

@CommandLine.Command(
name = CommandNames.LIST_TRANSLATIONS
name = CommandNames.LIST_TRANSLATIONS,
sortOptions = false
)
class ListTranslationsSubcommand extends ActCommandWithFiles {

@CommandLine.Option(names = {"--tree"})
@CommandLine.Option(names = {"--tree"}, order = -2)
protected boolean treeView;

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected NewAction<PropertiesWithFiles, ProjectClient> getAction(Actions actions) {
return actions.listTranslations(this.noProgress, this.treeView, false, this.plainView, false, true);
}

@CommandLine.Option(names = {"--plain"}, descriptionKey = "crowdin.list.usage.plain")
protected boolean plainView;

@Override
protected final boolean isAnsi() {
return super.isAnsi() && !plainView;
Expand Down
Loading