Skip to content

Commit 51fdac2

Browse files
authored
Merge pull request #526 from pamarcos/appimage-help
Add --appimage-help option
2 parents 6f3138f + c06da04 commit 51fdac2

File tree

2 files changed

+23
-1
lines changed

2 files changed

+23
-1
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Running an AppImage mounts the filesystem image and transparently runs the conta
6262

6363
If you invoke an AppImage built with a recent version of AppImageKit with one of these special command line arguments, then the AppImage will behave differently:
6464

65+
- `--appimage-help` prints the help options
6566
- `--appimage-offset` prints the offset at which the embedded filesystem image starts, and then exits. This is useful in case you would like to loop-mount the filesystem image using the `mount -o loop,offset=...` command
6667
- `--appimage-extract` extracts the contents from the embedded filesystem image, then exits. This is useful if you are using an AppImage on a system on which FUSE is not available
6768
- `--appimage-mount` mounts the embedded filesystem image and prints the mount point, then waits until it is killed. This is useful if you would like to inspect the contents of an AppImage without executing the contained payload application

Diff for: runtime.c

+22-1
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,20 @@ mkdir_p(const char *path)
204204
return 0;
205205
}
206206

207+
void
208+
print_help()
209+
{
210+
printf("AppImage Options:\n\n"
211+
"--appimage-help Prints this help\n"
212+
"--appimage-offset Prints the offset at which the embedded filesystem image starts, and then exits\n"
213+
"--appimage-extract Extracts the contents from the embedded filesystem image, then exit\n"
214+
"--appimage-mount Mounts the embedded filesystem image and prints the mount point, then waits until it is killed\n"
215+
"--appimage-version Prints the version of AppImageKit, then exits\n"
216+
"--appimage-updateinformation Prints the update information embedded into the AppImage, then exits\n"
217+
"--appimage-signature Prints the digital signature embedded into the AppImage, then exits\n"
218+
);
219+
}
220+
207221
int
208222
main (int argc, char *argv[])
209223
{
@@ -228,8 +242,15 @@ main (int argc, char *argv[])
228242

229243
fs_offset = get_elf_size(appimage_path);
230244

231-
/* Just print the offset and then exit */
232245
arg=getArg(argc,argv,'-');
246+
247+
/* Print the help and then exit */
248+
if(arg && strcmp(arg,"appimage-help")==0) {
249+
print_help();
250+
exit(0);
251+
}
252+
253+
/* Just print the offset and then exit */
233254
if(arg && strcmp(arg,"appimage-offset")==0) {
234255
printf("%lu\n", fs_offset);
235256
exit(0);

0 commit comments

Comments
 (0)