factorix 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/CHANGELOG.md +20 -0
- data/LICENSE.txt +21 -0
- data/README.md +105 -0
- data/completion/_factorix.bash +202 -0
- data/completion/_factorix.fish +197 -0
- data/completion/_factorix.zsh +376 -0
- data/doc/factorix.1 +377 -0
- data/exe/factorix +20 -0
- data/lib/factorix/api/category.rb +69 -0
- data/lib/factorix/api/image.rb +35 -0
- data/lib/factorix/api/license.rb +71 -0
- data/lib/factorix/api/mod_download_api.rb +66 -0
- data/lib/factorix/api/mod_info.rb +166 -0
- data/lib/factorix/api/mod_management_api.rb +237 -0
- data/lib/factorix/api/mod_portal_api.rb +204 -0
- data/lib/factorix/api/release.rb +49 -0
- data/lib/factorix/api/tag.rb +95 -0
- data/lib/factorix/api.rb +7 -0
- data/lib/factorix/api_credential.rb +54 -0
- data/lib/factorix/application.rb +218 -0
- data/lib/factorix/cache/file_system.rb +307 -0
- data/lib/factorix/cli/commands/backup_support.rb +46 -0
- data/lib/factorix/cli/commands/base.rb +90 -0
- data/lib/factorix/cli/commands/cache/evict.rb +180 -0
- data/lib/factorix/cli/commands/cache/stat.rb +201 -0
- data/lib/factorix/cli/commands/command_wrapper.rb +71 -0
- data/lib/factorix/cli/commands/completion.rb +83 -0
- data/lib/factorix/cli/commands/confirmable.rb +53 -0
- data/lib/factorix/cli/commands/download_support.rb +123 -0
- data/lib/factorix/cli/commands/launch.rb +79 -0
- data/lib/factorix/cli/commands/man.rb +29 -0
- data/lib/factorix/cli/commands/mod/check.rb +99 -0
- data/lib/factorix/cli/commands/mod/disable.rb +188 -0
- data/lib/factorix/cli/commands/mod/download.rb +291 -0
- data/lib/factorix/cli/commands/mod/edit.rb +114 -0
- data/lib/factorix/cli/commands/mod/enable.rb +216 -0
- data/lib/factorix/cli/commands/mod/image/add.rb +47 -0
- data/lib/factorix/cli/commands/mod/image/edit.rb +41 -0
- data/lib/factorix/cli/commands/mod/image/list.rb +74 -0
- data/lib/factorix/cli/commands/mod/install.rb +443 -0
- data/lib/factorix/cli/commands/mod/list.rb +372 -0
- data/lib/factorix/cli/commands/mod/search.rb +134 -0
- data/lib/factorix/cli/commands/mod/settings/dump.rb +88 -0
- data/lib/factorix/cli/commands/mod/settings/restore.rb +101 -0
- data/lib/factorix/cli/commands/mod/show.rb +202 -0
- data/lib/factorix/cli/commands/mod/sync.rb +299 -0
- data/lib/factorix/cli/commands/mod/uninstall.rb +325 -0
- data/lib/factorix/cli/commands/mod/update.rb +222 -0
- data/lib/factorix/cli/commands/mod/upload.rb +90 -0
- data/lib/factorix/cli/commands/path.rb +79 -0
- data/lib/factorix/cli/commands/requires_game_stopped.rb +32 -0
- data/lib/factorix/cli/commands/version.rb +25 -0
- data/lib/factorix/cli.rb +42 -0
- data/lib/factorix/dependency/edge.rb +89 -0
- data/lib/factorix/dependency/entry.rb +124 -0
- data/lib/factorix/dependency/graph/builder.rb +108 -0
- data/lib/factorix/dependency/graph.rb +210 -0
- data/lib/factorix/dependency/list.rb +244 -0
- data/lib/factorix/dependency/mod_version_requirement.rb +73 -0
- data/lib/factorix/dependency/node.rb +60 -0
- data/lib/factorix/dependency/parser.rb +148 -0
- data/lib/factorix/dependency/validation_result.rb +138 -0
- data/lib/factorix/dependency/validator.rb +190 -0
- data/lib/factorix/errors.rb +112 -0
- data/lib/factorix/formatting.rb +56 -0
- data/lib/factorix/game_version.rb +98 -0
- data/lib/factorix/http/cache_decorator.rb +106 -0
- data/lib/factorix/http/cached_response.rb +37 -0
- data/lib/factorix/http/client.rb +187 -0
- data/lib/factorix/http/response.rb +31 -0
- data/lib/factorix/http/retry_decorator.rb +59 -0
- data/lib/factorix/http/retry_strategy.rb +80 -0
- data/lib/factorix/info_json.rb +90 -0
- data/lib/factorix/installed_mod.rb +239 -0
- data/lib/factorix/mod.rb +55 -0
- data/lib/factorix/mod_list.rb +174 -0
- data/lib/factorix/mod_settings.rb +278 -0
- data/lib/factorix/mod_state.rb +34 -0
- data/lib/factorix/mod_version.rb +99 -0
- data/lib/factorix/portal.rb +185 -0
- data/lib/factorix/progress/download_handler.rb +46 -0
- data/lib/factorix/progress/multi_presenter.rb +45 -0
- data/lib/factorix/progress/presenter.rb +67 -0
- data/lib/factorix/progress/presenter_adapter.rb +46 -0
- data/lib/factorix/progress/scan_handler.rb +33 -0
- data/lib/factorix/progress/upload_handler.rb +33 -0
- data/lib/factorix/runtime/base.rb +233 -0
- data/lib/factorix/runtime/linux.rb +32 -0
- data/lib/factorix/runtime/mac_os.rb +53 -0
- data/lib/factorix/runtime/user_configurable.rb +69 -0
- data/lib/factorix/runtime/windows.rb +85 -0
- data/lib/factorix/runtime/wsl.rb +118 -0
- data/lib/factorix/runtime.rb +32 -0
- data/lib/factorix/save_file.rb +178 -0
- data/lib/factorix/ser_des/deserializer.rb +198 -0
- data/lib/factorix/ser_des/serializer.rb +231 -0
- data/lib/factorix/ser_des/signed_integer.rb +63 -0
- data/lib/factorix/ser_des/unsigned_integer.rb +65 -0
- data/lib/factorix/service_credential.rb +127 -0
- data/lib/factorix/transfer/downloader.rb +162 -0
- data/lib/factorix/transfer/uploader.rb +232 -0
- data/lib/factorix/version.rb +6 -0
- data/lib/factorix.rb +38 -0
- data/sig/dry/auto_inject.rbs +15 -0
- data/sig/dry/cli.rbs +19 -0
- data/sig/dry/configurable.rbs +13 -0
- data/sig/dry/core/container.rbs +17 -0
- data/sig/dry/events/publisher.rbs +22 -0
- data/sig/dry/logger.rbs +16 -0
- data/sig/factorix/api/category.rbs +15 -0
- data/sig/factorix/api/image.rbs +15 -0
- data/sig/factorix/api/license.rbs +20 -0
- data/sig/factorix/api/mod_download_api.rbs +18 -0
- data/sig/factorix/api/mod_info.rbs +67 -0
- data/sig/factorix/api/mod_management_api.rbs +25 -0
- data/sig/factorix/api/mod_portal_api.rbs +31 -0
- data/sig/factorix/api/release.rbs +27 -0
- data/sig/factorix/api/tag.rbs +15 -0
- data/sig/factorix/api.rbs +8 -0
- data/sig/factorix/api_credential.rbs +17 -0
- data/sig/factorix/application.rbs +86 -0
- data/sig/factorix/cache/file_system.rbs +35 -0
- data/sig/factorix/cli/commands/base.rbs +13 -0
- data/sig/factorix/cli/commands/cache/evict.rbs +17 -0
- data/sig/factorix/cli/commands/cache/stat.rbs +17 -0
- data/sig/factorix/cli/commands/command_wrapper.rbs +13 -0
- data/sig/factorix/cli/commands/completion/zsh.rbs +15 -0
- data/sig/factorix/cli/commands/confirmable.rbs +12 -0
- data/sig/factorix/cli/commands/download_support.rbs +12 -0
- data/sig/factorix/cli/commands/launch.rbs +15 -0
- data/sig/factorix/cli/commands/mod/check.rbs +18 -0
- data/sig/factorix/cli/commands/mod/disable.rbs +20 -0
- data/sig/factorix/cli/commands/mod/download.rbs +18 -0
- data/sig/factorix/cli/commands/mod/edit.rbs +30 -0
- data/sig/factorix/cli/commands/mod/enable.rbs +20 -0
- data/sig/factorix/cli/commands/mod/image/add.rbs +19 -0
- data/sig/factorix/cli/commands/mod/image/edit.rbs +19 -0
- data/sig/factorix/cli/commands/mod/image/list.rbs +19 -0
- data/sig/factorix/cli/commands/mod/install.rbs +19 -0
- data/sig/factorix/cli/commands/mod/list.rbs +30 -0
- data/sig/factorix/cli/commands/mod/search.rbs +18 -0
- data/sig/factorix/cli/commands/mod/settings/dump.rbs +17 -0
- data/sig/factorix/cli/commands/mod/settings/restore.rbs +17 -0
- data/sig/factorix/cli/commands/mod/sync.rbs +19 -0
- data/sig/factorix/cli/commands/mod/uninstall.rbs +20 -0
- data/sig/factorix/cli/commands/mod/update.rbs +19 -0
- data/sig/factorix/cli/commands/mod/upload.rbs +24 -0
- data/sig/factorix/cli/commands/path.rbs +18 -0
- data/sig/factorix/cli/commands/requires_game_stopped.rbs +13 -0
- data/sig/factorix/cli/commands/version.rbs +13 -0
- data/sig/factorix/cli.rbs +11 -0
- data/sig/factorix/dependency/edge.rbs +32 -0
- data/sig/factorix/dependency/entry.rbs +30 -0
- data/sig/factorix/dependency/graph/builder.rbs +17 -0
- data/sig/factorix/dependency/graph.rbs +39 -0
- data/sig/factorix/dependency/list.rbs +69 -0
- data/sig/factorix/dependency/mod_version_requirement.rbs +18 -0
- data/sig/factorix/dependency/node.rbs +24 -0
- data/sig/factorix/dependency/parser.rbs +11 -0
- data/sig/factorix/dependency/validation_result.rbs +56 -0
- data/sig/factorix/dependency/validator.rbs +13 -0
- data/sig/factorix/errors.rbs +132 -0
- data/sig/factorix/formatting.rbs +8 -0
- data/sig/factorix/game_version.rbs +24 -0
- data/sig/factorix/http/cache_decorator.rbs +64 -0
- data/sig/factorix/http/client.rbs +55 -0
- data/sig/factorix/http/response.rbs +28 -0
- data/sig/factorix/http/retry_decorator.rbs +44 -0
- data/sig/factorix/http/retry_strategy.rbs +42 -0
- data/sig/factorix/info_json.rbs +19 -0
- data/sig/factorix/installed_mod.rbs +34 -0
- data/sig/factorix/mod.rbs +20 -0
- data/sig/factorix/mod_list.rbs +44 -0
- data/sig/factorix/mod_settings.rbs +47 -0
- data/sig/factorix/mod_state.rbs +18 -0
- data/sig/factorix/mod_version.rbs +23 -0
- data/sig/factorix/portal.rbs +37 -0
- data/sig/factorix/progress/download_handler.rbs +19 -0
- data/sig/factorix/progress/multi_presenter.rbs +15 -0
- data/sig/factorix/progress/presenter.rbs +17 -0
- data/sig/factorix/progress/presenter_adapter.rbs +17 -0
- data/sig/factorix/progress/scan_handler.rbs +16 -0
- data/sig/factorix/progress/upload_handler.rbs +17 -0
- data/sig/factorix/runtime/base.rbs +45 -0
- data/sig/factorix/runtime/linux.rbs +15 -0
- data/sig/factorix/runtime/mac_os.rbs +15 -0
- data/sig/factorix/runtime/user_configurable.rbs +13 -0
- data/sig/factorix/runtime/windows.rbs +23 -0
- data/sig/factorix/runtime/wsl.rbs +19 -0
- data/sig/factorix/runtime.rbs +9 -0
- data/sig/factorix/save_file.rbs +40 -0
- data/sig/factorix/ser_des/deserializer.rbs +49 -0
- data/sig/factorix/ser_des/serializer.rbs +45 -0
- data/sig/factorix/ser_des/signed_integer.rbs +37 -0
- data/sig/factorix/ser_des/unsigned_integer.rbs +37 -0
- data/sig/factorix/service_credential.rbs +19 -0
- data/sig/factorix/transfer/downloader.rbs +15 -0
- data/sig/factorix/transfer/uploader.rbs +21 -0
- data/sig/factorix.rbs +9 -0
- data/sig/tty/progressbar.rbs +18 -0
- metadata +431 -0
|
@@ -0,0 +1,376 @@
|
|
|
1
|
+
#compdef factorix
|
|
2
|
+
|
|
3
|
+
# Zsh completion for factorix
|
|
4
|
+
# Output by: factorix completion zsh
|
|
5
|
+
|
|
6
|
+
# Helper function to get installed MOD names
|
|
7
|
+
_factorix_installed_mods() {
|
|
8
|
+
local -a mods
|
|
9
|
+
mods=(${(f)"$(factorix mod list --json 2>/dev/null | jq -r '.[].name')"})
|
|
10
|
+
[[ ${#mods} -gt 0 ]] && _describe -t mods 'installed MOD' mods
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
_factorix() {
|
|
14
|
+
local context state state_descr line
|
|
15
|
+
typeset -A opt_args
|
|
16
|
+
|
|
17
|
+
local -a global_opts
|
|
18
|
+
global_opts=(
|
|
19
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
20
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
21
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
local -a confirmable_opts
|
|
25
|
+
confirmable_opts=(
|
|
26
|
+
'(-y --yes)'{-y,--yes}'[Skip confirmation prompts]'
|
|
27
|
+
)
|
|
28
|
+
|
|
29
|
+
_arguments -C \
|
|
30
|
+
$global_opts \
|
|
31
|
+
'1:command:->command' \
|
|
32
|
+
'*::arg:->args'
|
|
33
|
+
|
|
34
|
+
case $state in
|
|
35
|
+
command)
|
|
36
|
+
local -a commands
|
|
37
|
+
commands=(
|
|
38
|
+
'version:Display Factorix version'
|
|
39
|
+
'man:Display the Factorix manual page'
|
|
40
|
+
'launch:Launch Factorio game'
|
|
41
|
+
'path:Display Factorio and Factorix paths'
|
|
42
|
+
'mod:MOD management commands'
|
|
43
|
+
'cache:Cache management commands'
|
|
44
|
+
'completion:Generate shell completion script'
|
|
45
|
+
)
|
|
46
|
+
_describe -t commands 'factorix command' commands
|
|
47
|
+
;;
|
|
48
|
+
args)
|
|
49
|
+
case $line[1] in
|
|
50
|
+
version|man)
|
|
51
|
+
_arguments $global_opts
|
|
52
|
+
;;
|
|
53
|
+
launch)
|
|
54
|
+
_arguments \
|
|
55
|
+
$global_opts \
|
|
56
|
+
'(-w --wait)'{-w,--wait}'[Wait for the game to finish]' \
|
|
57
|
+
'*:Factorio arguments:'
|
|
58
|
+
;;
|
|
59
|
+
path)
|
|
60
|
+
_arguments \
|
|
61
|
+
$global_opts \
|
|
62
|
+
'--json[Output in JSON format]'
|
|
63
|
+
;;
|
|
64
|
+
completion)
|
|
65
|
+
_factorix_completion
|
|
66
|
+
;;
|
|
67
|
+
mod)
|
|
68
|
+
_factorix_mod
|
|
69
|
+
;;
|
|
70
|
+
cache)
|
|
71
|
+
_factorix_cache
|
|
72
|
+
;;
|
|
73
|
+
esac
|
|
74
|
+
;;
|
|
75
|
+
esac
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
_factorix_completion() {
|
|
79
|
+
local -a global_opts
|
|
80
|
+
global_opts=(
|
|
81
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
82
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
83
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
_arguments \
|
|
87
|
+
$global_opts \
|
|
88
|
+
'1:shell:(zsh bash fish)'
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_factorix_mod() {
|
|
92
|
+
local context state state_descr line
|
|
93
|
+
typeset -A opt_args
|
|
94
|
+
|
|
95
|
+
local -a global_opts
|
|
96
|
+
global_opts=(
|
|
97
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
98
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
99
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
local -a confirmable_opts
|
|
103
|
+
confirmable_opts=(
|
|
104
|
+
'(-y --yes)'{-y,--yes}'[Skip confirmation prompts]'
|
|
105
|
+
)
|
|
106
|
+
|
|
107
|
+
_arguments -C \
|
|
108
|
+
'1:subcommand:->subcommand' \
|
|
109
|
+
'*::arg:->args'
|
|
110
|
+
|
|
111
|
+
case $state in
|
|
112
|
+
subcommand)
|
|
113
|
+
local -a subcommands
|
|
114
|
+
subcommands=(
|
|
115
|
+
'check:Check MOD dependencies'
|
|
116
|
+
'list:List installed MODs'
|
|
117
|
+
'show:Show MOD details from Factorio MOD Portal'
|
|
118
|
+
'enable:Enable MODs'
|
|
119
|
+
'disable:Disable MODs'
|
|
120
|
+
'install:Install MODs from Factorio MOD Portal'
|
|
121
|
+
'uninstall:Uninstall MODs'
|
|
122
|
+
'update:Update MODs'
|
|
123
|
+
'download:Download MODs without installing'
|
|
124
|
+
'upload:Upload MOD to Factorio MOD Portal'
|
|
125
|
+
'edit:Edit MOD metadata on Factorio MOD Portal'
|
|
126
|
+
'search:Search MODs on Factorio MOD Portal'
|
|
127
|
+
'sync:Sync MOD states from a save file'
|
|
128
|
+
'image:MOD image management'
|
|
129
|
+
'settings:MOD settings management'
|
|
130
|
+
)
|
|
131
|
+
_describe -t subcommands 'mod subcommand' subcommands
|
|
132
|
+
;;
|
|
133
|
+
args)
|
|
134
|
+
case $line[1] in
|
|
135
|
+
check)
|
|
136
|
+
_arguments $global_opts
|
|
137
|
+
;;
|
|
138
|
+
list)
|
|
139
|
+
_arguments \
|
|
140
|
+
$global_opts \
|
|
141
|
+
'--enabled[Show only enabled MODs]' \
|
|
142
|
+
'--disabled[Show only disabled MODs]' \
|
|
143
|
+
'--errors[Show only MODs with dependency errors]' \
|
|
144
|
+
'--outdated[Show only MODs with available updates]' \
|
|
145
|
+
'--json[Output in JSON format]'
|
|
146
|
+
;;
|
|
147
|
+
show)
|
|
148
|
+
_arguments \
|
|
149
|
+
$global_opts \
|
|
150
|
+
'1:MOD name:'
|
|
151
|
+
;;
|
|
152
|
+
enable)
|
|
153
|
+
_arguments \
|
|
154
|
+
$global_opts \
|
|
155
|
+
$confirmable_opts \
|
|
156
|
+
'*:MOD name:_factorix_installed_mods'
|
|
157
|
+
;;
|
|
158
|
+
disable)
|
|
159
|
+
_arguments \
|
|
160
|
+
$global_opts \
|
|
161
|
+
$confirmable_opts \
|
|
162
|
+
'*:MOD name:_factorix_installed_mods'
|
|
163
|
+
;;
|
|
164
|
+
install)
|
|
165
|
+
_arguments \
|
|
166
|
+
$global_opts \
|
|
167
|
+
$confirmable_opts \
|
|
168
|
+
'(-j --jobs)'{-j,--jobs}'[Number of parallel downloads]:jobs:' \
|
|
169
|
+
'*:MOD specification:'
|
|
170
|
+
;;
|
|
171
|
+
uninstall)
|
|
172
|
+
_arguments \
|
|
173
|
+
$global_opts \
|
|
174
|
+
$confirmable_opts \
|
|
175
|
+
'--all[Uninstall all MODs]' \
|
|
176
|
+
'*:MOD name:_factorix_installed_mods'
|
|
177
|
+
;;
|
|
178
|
+
update)
|
|
179
|
+
_arguments \
|
|
180
|
+
$global_opts \
|
|
181
|
+
$confirmable_opts \
|
|
182
|
+
'(-j --jobs)'{-j,--jobs}'[Number of parallel downloads]:jobs:' \
|
|
183
|
+
'*:MOD name:_factorix_installed_mods'
|
|
184
|
+
;;
|
|
185
|
+
download)
|
|
186
|
+
_arguments \
|
|
187
|
+
$global_opts \
|
|
188
|
+
'(-d --directory)'{-d,--directory}'[Download directory]:directory:_files -/' \
|
|
189
|
+
'(-j --jobs)'{-j,--jobs}'[Number of parallel downloads]:jobs:' \
|
|
190
|
+
'(-r --recursive)'{-r,--recursive}'[Include required dependencies recursively]' \
|
|
191
|
+
'*:MOD specification:'
|
|
192
|
+
;;
|
|
193
|
+
upload)
|
|
194
|
+
_arguments \
|
|
195
|
+
$global_opts \
|
|
196
|
+
'--description[Markdown description]:description:' \
|
|
197
|
+
'--category[MOD category]:category:(content overhaul tweaks utilities scenarios mod-packs localizations internal no-category)' \
|
|
198
|
+
'--license[License identifier]:license:(default_mit default_gnugplv3 default_gnulgplv3 default_mozilla2 default_apache2 default_unlicense)' \
|
|
199
|
+
'--source-url[Repository URL]:url:' \
|
|
200
|
+
'1:MOD zip file:_files -g "*.zip"'
|
|
201
|
+
;;
|
|
202
|
+
edit)
|
|
203
|
+
_arguments \
|
|
204
|
+
$global_opts \
|
|
205
|
+
'--description[Markdown description]:description:' \
|
|
206
|
+
'--summary[Brief description]:summary:' \
|
|
207
|
+
'--title[MOD title]:title:' \
|
|
208
|
+
'--category[MOD category]:category:(content overhaul tweaks utilities scenarios mod-packs localizations internal no-category)' \
|
|
209
|
+
'--tags[Tags]: :_values -s , tag transportation logistics trains combat armor enemies character environment planets mining fluids logistic-network circuit-network manufacturing power storage blueprints cheats' \
|
|
210
|
+
'--license[License identifier]:license:(default_mit default_gnugplv3 default_gnulgplv3 default_mozilla2 default_apache2 default_unlicense)' \
|
|
211
|
+
'--homepage[Homepage URL]:url:' \
|
|
212
|
+
'--source-url[Repository URL]:url:' \
|
|
213
|
+
'--faq[FAQ text]:faq:' \
|
|
214
|
+
'--deprecated[Deprecation flag]' \
|
|
215
|
+
'--no-deprecated[Clear deprecation flag]' \
|
|
216
|
+
'1:MOD name:'
|
|
217
|
+
;;
|
|
218
|
+
search)
|
|
219
|
+
_arguments \
|
|
220
|
+
$global_opts \
|
|
221
|
+
'--hide-deprecated[Hide deprecated MODs]' \
|
|
222
|
+
'--no-hide-deprecated[Show deprecated MODs]' \
|
|
223
|
+
'--page[Page number]:page:' \
|
|
224
|
+
'--page-size[Results per page]:size:' \
|
|
225
|
+
'--sort[Sort field]:sort:(name created_at updated_at)' \
|
|
226
|
+
'--sort-order[Sort order]:order:(asc desc)' \
|
|
227
|
+
'--version[Filter by Factorio version]:version:' \
|
|
228
|
+
'--json[Output in JSON format]' \
|
|
229
|
+
'*:MOD name:'
|
|
230
|
+
;;
|
|
231
|
+
sync)
|
|
232
|
+
_arguments \
|
|
233
|
+
$global_opts \
|
|
234
|
+
$confirmable_opts \
|
|
235
|
+
'(-j --jobs)'{-j,--jobs}'[Number of parallel downloads]:jobs:' \
|
|
236
|
+
'1:save file:_files -g "*.zip"'
|
|
237
|
+
;;
|
|
238
|
+
image)
|
|
239
|
+
_factorix_mod_image
|
|
240
|
+
;;
|
|
241
|
+
settings)
|
|
242
|
+
_factorix_mod_settings
|
|
243
|
+
;;
|
|
244
|
+
esac
|
|
245
|
+
;;
|
|
246
|
+
esac
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
_factorix_mod_image() {
|
|
250
|
+
local context state state_descr line
|
|
251
|
+
typeset -A opt_args
|
|
252
|
+
|
|
253
|
+
local -a global_opts
|
|
254
|
+
global_opts=(
|
|
255
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
256
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
257
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
258
|
+
)
|
|
259
|
+
|
|
260
|
+
_arguments -C \
|
|
261
|
+
'1:subcommand:->subcommand' \
|
|
262
|
+
'*::arg:->args'
|
|
263
|
+
|
|
264
|
+
case $state in
|
|
265
|
+
subcommand)
|
|
266
|
+
local -a subcommands
|
|
267
|
+
subcommands=(
|
|
268
|
+
'list:List MOD images'
|
|
269
|
+
'add:Add an image to a MOD'
|
|
270
|
+
'edit:Edit MOD images'
|
|
271
|
+
)
|
|
272
|
+
_describe -t subcommands 'image subcommand' subcommands
|
|
273
|
+
;;
|
|
274
|
+
args)
|
|
275
|
+
case $line[1] in
|
|
276
|
+
list)
|
|
277
|
+
_arguments \
|
|
278
|
+
$global_opts \
|
|
279
|
+
'1:MOD name:'
|
|
280
|
+
;;
|
|
281
|
+
add)
|
|
282
|
+
_arguments \
|
|
283
|
+
$global_opts \
|
|
284
|
+
'1:MOD name:' \
|
|
285
|
+
'2:image file:_files -g "*.png *.jpg *.jpeg *.gif"'
|
|
286
|
+
;;
|
|
287
|
+
edit)
|
|
288
|
+
_arguments \
|
|
289
|
+
$global_opts \
|
|
290
|
+
'1:MOD name:'
|
|
291
|
+
;;
|
|
292
|
+
esac
|
|
293
|
+
;;
|
|
294
|
+
esac
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
_factorix_mod_settings() {
|
|
298
|
+
local context state state_descr line
|
|
299
|
+
typeset -A opt_args
|
|
300
|
+
|
|
301
|
+
local -a global_opts
|
|
302
|
+
global_opts=(
|
|
303
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
304
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
305
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
306
|
+
)
|
|
307
|
+
|
|
308
|
+
_arguments -C \
|
|
309
|
+
'1:subcommand:->subcommand' \
|
|
310
|
+
'*::arg:->args'
|
|
311
|
+
|
|
312
|
+
case $state in
|
|
313
|
+
subcommand)
|
|
314
|
+
local -a subcommands
|
|
315
|
+
subcommands=(
|
|
316
|
+
'dump:Dump MOD settings to JSON'
|
|
317
|
+
'restore:Restore MOD settings from JSON'
|
|
318
|
+
)
|
|
319
|
+
_describe -t subcommands 'settings subcommand' subcommands
|
|
320
|
+
;;
|
|
321
|
+
args)
|
|
322
|
+
case $line[1] in
|
|
323
|
+
dump|restore)
|
|
324
|
+
_arguments $global_opts
|
|
325
|
+
;;
|
|
326
|
+
esac
|
|
327
|
+
;;
|
|
328
|
+
esac
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
_factorix_cache() {
|
|
332
|
+
local context state state_descr line
|
|
333
|
+
typeset -A opt_args
|
|
334
|
+
|
|
335
|
+
local -a global_opts
|
|
336
|
+
global_opts=(
|
|
337
|
+
'(-c --config-path)'{-c,--config-path}'[Path to configuration file]:config file:_files'
|
|
338
|
+
'--log-level[Set log level]:level:(debug info warn error fatal)'
|
|
339
|
+
'(-q --quiet)'{-q,--quiet}'[Suppress non-essential output]'
|
|
340
|
+
)
|
|
341
|
+
|
|
342
|
+
_arguments -C \
|
|
343
|
+
'1:subcommand:->subcommand' \
|
|
344
|
+
'*::arg:->args'
|
|
345
|
+
|
|
346
|
+
case $state in
|
|
347
|
+
subcommand)
|
|
348
|
+
local -a subcommands
|
|
349
|
+
subcommands=(
|
|
350
|
+
'stat:Display cache statistics'
|
|
351
|
+
'evict:Evict cache entries'
|
|
352
|
+
)
|
|
353
|
+
_describe -t subcommands 'cache subcommand' subcommands
|
|
354
|
+
;;
|
|
355
|
+
args)
|
|
356
|
+
case $line[1] in
|
|
357
|
+
stat)
|
|
358
|
+
_arguments \
|
|
359
|
+
$global_opts \
|
|
360
|
+
'--json[Output in JSON format]'
|
|
361
|
+
;;
|
|
362
|
+
evict)
|
|
363
|
+
_arguments \
|
|
364
|
+
$global_opts \
|
|
365
|
+
'--all[Remove all entries]' \
|
|
366
|
+
'--expired[Remove expired entries only]' \
|
|
367
|
+
'--older-than[Remove entries older than AGE]:age:' \
|
|
368
|
+
'*:cache name:(download api info_json)'
|
|
369
|
+
;;
|
|
370
|
+
esac
|
|
371
|
+
;;
|
|
372
|
+
esac
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
# Register the completion function
|
|
376
|
+
compdef _factorix factorix
|