COMPREPLY=( $(compgen -W "size" -- $cur) )
return 0
;;
+ '-m'|'--posix-shmem')
+ COMPREPLY=( $(compgen -W "size" -- $cur) )
+ return 0
+ ;;
'-S'|'--semaphore')
COMPREPLY=( $(compgen -W "number" -- $cur) )
return 0
;;
+ '-s'|'--posix-semaphore'|'-Q'|'--queue'|'-q'|'--posix-mqueue')
+ return 0
+ ;;
'-p'|'--mode')
COMPREPLY=( $(compgen -W "mode" -- $cur) )
return 0
;;
+ '-n'|'--name')
+ COMPREPLY=( $(compgen -W "name" -- $cur) )
+ return 0
+ ;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
- COMPREPLY=( $(compgen -W "--shmem --semaphore --queue --mode --help --version" -- $cur) )
+ COMPREPLY=( $(compgen -W "--shmem --posix-shmem --semaphore --posix-semaphore --queue --posix-mqueue --mode --name --help --version" -- $cur) )
return 0
}
complete -F _ipcmk_module ipcmk
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-m'|'--shmem-id')
- KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $2}}')"
+ KEYIDS="$(lsipc -m | awk 'NR>1 {print $2}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-M'|'--shmem-key')
- KEYIDS="$(ipcs -m | awk '{if (3 < NR) {print $1}}')"
+ KEYIDS="$(lsipc -m | awk 'NR>1 {print $1}')"
+ COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
+ return 0
+ ;;
+ '--posix-shmem')
+ KEYIDS="$(lsipc -M | awk 'NR>1 {print $1}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-q'|'--queue-id')
- KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $2}}')"
+ KEYIDS="$(lsipc -q | awk 'NR>1 {print $2}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-Q'|'--queue-key')
- KEYIDS="$(ipcs -q | awk '{if (3 < NR) {print $1}}')"
+ KEYIDS="$(lsipc -q | awk 'NR>1 {print $1}')"
+ COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
+ return 0
+ ;;
+ '--posix-mqueue')
+ KEYIDS="$(lsipc -Q | awk 'NR>1 {print $1}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-s'|'--semaphore-id')
- KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $2}}')"
+ KEYIDS="$(lsipc -s | awk '{if (3 < NR) {print $2}}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
'-S'|'--semaphore-key')
- KEYIDS="$(ipcs -s | awk '{if (3 < NR) {print $1}}')"
+ KEYIDS="$(lsipc -s | awk '{if (3 < NR) {print $1}}')"
+ COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
+ return 0
+ ;;
+ '--posix-semaphore')
+ KEYIDS="$(lsipc -S | awk 'NR>1 {print $1}')"
COMPREPLY=( $(compgen -W "$KEYIDS" -- $cur) )
return 0
;;
case $cur in
'=')
cur=${cur#=}
- COMPREPLY=( $(compgen -W "shm msg sem" -- $cur) )
+ COMPREPLY=( $(compgen -W "shm pshm msg pmsg sem psem" -- $cur) )
return 0
;;
esac
OPTS=" --shmem-id
--shmem-key
+ --posix-shmem
--queue-id
--queue-key
+ --posix-mqueue
--semaphore-id
--semaphore-key
+ --posix-semaphore
--all=
--verbose
--help
COMPREPLY=( $(compgen -W "id" -- $cur) )
return 0
;;
+ '-N'|'--name')
+ COMPREPLY=( $(compgen -W "name" -- $cur) )
+ return 0
+ ;;
'-h'|'--help'|'-V'|'--version')
return 0
;;
esac
OPTS="
--shmems
+ --posix-shmems
--queues
+ --posix-mqueues
--semaphores
+ --posix-semaphores
--global
--id
+ --name
--noheadings
--notruncate
--time-format
--numeric-perms
--raw
--time
+ --shell
--help
--version
"
== AUTHORS
-mailto:hayden.james@gmail.com[Hayden A. James]
+mailto:hayden.james@gmail.com[Hayden A. James],
+mailto:paithankarprasanna@gmail.com[Prasanna Paithankar]
== SEE ALSO
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include <errno.h>
{"shmem", required_argument, NULL, 'M'},
{"posix-shmem", required_argument, NULL, 'm'},
{"semaphore", required_argument, NULL, 'S'},
- {"posix-semaphore", required_argument, NULL, 's'},
+ {"posix-semaphore", no_argument, NULL, 's'},
{"queue", no_argument, NULL, 'Q'},
{"posix-mqueue", no_argument, NULL, 'q'},
{"mode", required_argument, NULL, 'p'},
*
* 1999-04-02 frank zago
* - can now remove several id's in the same call
+ *
+ * 2025 Prasanna Paithankar <paithankarprasanna@gmail.com>
+ * - Added POSIX IPC support
*/
#include <errno.h>
#include <getopt.h>