Skip to content

Commit 84892a2

Browse files
authored
Add --help flag to file_packager.py (#24117)
1 parent 9a545ba commit 84892a2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

tools/file_packager.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
2222
Usage:
2323
24-
file_packager TARGET [--preload A [B..]] [--embed C [D..]] [--exclude E [F..]]] [--js-output=OUTPUT.js] [--no-force] [--use-preload-cache] [--indexedDB-name=EM_PRELOAD_CACHE] [--separate-metadata] [--lz4] [--use-preload-plugins] [--no-node]
24+
file_packager TARGET [--preload A [B..]] [--embed C [D..]] [--exclude E [F..]] [--js-output=OUTPUT.js] [--no-force] [--use-preload-cache] [--indexedDB-name=EM_PRELOAD_CACHE] [--separate-metadata] [--lz4] [--use-preload-plugins] [--no-node] [--help]
2525
2626
--preload ,
2727
--embed See emcc --help for more details on those options.
@@ -365,8 +365,8 @@ def main(): # noqa: C901, PLR0912, PLR0915
365365
To revalidate these numbers, run `ruff check --select=C901,PLR091`.
366366
"""
367367
if len(sys.argv) == 1:
368-
err('''Usage: file_packager TARGET [--preload A [B..]] [--embed C [D..]] [--exclude E [F..]]] [--js-output=OUTPUT.js] [--no-force] [--use-preload-cache] [--indexedDB-name=EM_PRELOAD_CACHE] [--separate-metadata] [--lz4] [--use-preload-plugins] [--no-node]
369-
See the source for more details.''')
368+
err('''Usage: file_packager TARGET [--preload A [B..]] [--embed C [D..]] [--exclude E [F..]] [--js-output=OUTPUT.js] [--no-force] [--use-preload-cache] [--indexedDB-name=EM_PRELOAD_CACHE] [--separate-metadata] [--lz4] [--use-preload-plugins] [--no-node] [--help]
369+
Try 'file_packager --help' for more details.''')
370370
return 1
371371

372372
# read response files very early on
@@ -375,6 +375,10 @@ def main(): # noqa: C901, PLR0912, PLR0915
375375
except IOError as e:
376376
shared.exit_with_error(e)
377377

378+
if '--help' in args:
379+
print(__doc__.strip())
380+
return 0
381+
378382
data_target = args[0]
379383
data_files = []
380384
plugins = []

0 commit comments

Comments
 (0)