Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

[PATCH] update _gcore (support darwin)



Add support for macOS, with small updates for GNU (accept multiple pids).


diff --git a/Completion/Unix/Command/_gcore b/Completion/Unix/Command/_gcore
index 07a65cd9a..913ef25ca 100644
--- a/Completion/Unix/Command/_gcore
+++ b/Completion/Unix/Command/_gcore
@@ -49,10 +49,20 @@ case $OSTYPE in
       '::executable:' \
       ':pid:_pids'
   ;;
+  darwin*)
+    _arguments -s -A '-*' \
+      '-s[suspend the process while the core file is captured]' \
+      '-v[report progress on the dump as it proceeds]' \
+      '-b+[specify maximum size of core file]:size (MiB): ' \
+      '(-c)-o+[write core file to specified file]:file:_files' \
+      '(-o)-c+[specify format of core file name]:format:{_message "%%N\:program name, %%U\:uid, %%P\:pid, %%T\:time stamp"}' \
+      '1:pid:_pids'
+  ;;
   *)
     # GNU GDB gcore
-    _arguments \
-      '-o[set core file base name]:file base name:_files' \
-      ':pid:_pids'
+    _arguments -s -A '-*' \
+      '-a[dump all memory mappings]' \
+      '-o+[set core file base name]:file base name:_files' \
+      '*:pid:_pids'
   ;;
 esac









Messages sorted by: Reverse Date, Date, Thread, Author