mirror of
https://github.com/mitb-archive/filebot
synced 2025-03-10 06:20:27 -04:00
Add compspec for --def
This commit is contained in:
parent
c3d9a06e70
commit
212e27f866
@ -95,6 +95,7 @@ function _picocli_filebot() {
|
|||||||
conflict_OPTION_ARGS="skip override fail auto index" # --conflict values
|
conflict_OPTION_ARGS="skip override fail auto index" # --conflict values
|
||||||
lang_OPTION_ARGS="Albanian Arabic Armenian Bulgarian Catalan Croatian Czech Danish Dutch English Finnish French Canadian French German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Romanized Japanese Korean Latvian Lithuanian Macedonian Malay Chinese Taiwanese Chinese Cantonese Norwegian Persian Polish Portuguese Brazilian Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Mexican Spanish Swedish Thai Turkish Ukrainian Vietnamese" # --lang values
|
lang_OPTION_ARGS="Albanian Arabic Armenian Bulgarian Catalan Croatian Czech Danish Dutch English Finnish French Canadian French German Greek Hebrew Hindi Hungarian Icelandic Indonesian Italian Japanese Romanized Japanese Korean Latvian Lithuanian Macedonian Malay Chinese Taiwanese Chinese Cantonese Norwegian Persian Polish Portuguese Brazilian Portuguese Romanian Russian Serbian Slovak Slovenian Spanish Mexican Spanish Swedish Thai Turkish Ukrainian Vietnamese" # --lang values
|
||||||
encoding_OPTION_ARGS="UTF-8 Windows-1252 ISO-8859-1" # --encoding values
|
encoding_OPTION_ARGS="UTF-8 Windows-1252 ISO-8859-1" # --encoding values
|
||||||
|
StringString_OPTION_ARGS="name=value" # --def values
|
||||||
log_OPTION_ARGS="OFF SEVERE WARNING INFO CONFIG FINE FINER FINEST ALL" # --log values
|
log_OPTION_ARGS="OFF SEVERE WARNING INFO CONFIG FINE FINER FINEST ALL" # --log values
|
||||||
|
|
||||||
compopt +o default
|
compopt +o default
|
||||||
@ -157,7 +158,8 @@ function _picocli_filebot() {
|
|||||||
return $?
|
return $?
|
||||||
;;
|
;;
|
||||||
--def)
|
--def)
|
||||||
return
|
COMPREPLY=( $( compgen -W "${StringString_OPTION_ARGS}" -- ${CURR_WORD} ) )
|
||||||
|
return $?
|
||||||
;;
|
;;
|
||||||
--file-filter)
|
--file-filter)
|
||||||
compopt -o filenames
|
compopt -o filenames
|
||||||
|
@ -85,7 +85,7 @@ class BashCompletionBuilder {
|
|||||||
@Option(names = "-script", description = "Run Groovy script")
|
@Option(names = "-script", description = "Run Groovy script")
|
||||||
public File script;
|
public File script;
|
||||||
|
|
||||||
@Option(names = "--def", description = "Define script variables")
|
@Option(names = "--def", description = "Define script variables", completionCandidates = DefineCompletionCandidates.class)
|
||||||
public Map<String, String> defines;
|
public Map<String, String> defines;
|
||||||
|
|
||||||
@Option(names = "-r", description = "Recursively process folders")
|
@Option(names = "-r", description = "Recursively process folders")
|
||||||
@ -194,8 +194,16 @@ class BashCompletionBuilder {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static class DefineCompletionCandidates implements Iterable<String> {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Iterator<String> iterator() {
|
||||||
|
return Stream.of("name=value").iterator();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
AutoComplete.main("-n", "filebot", BashCompletionBuilder.class.getName());
|
AutoComplete.main("--name", "filebot", BashCompletionBuilder.class.getName(), "--force");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user