This package allows you to query the arguments of other processes on macOS.
Add the package to your project's pom.xml by adding:
<dependency>
<groupId>cam.narzt.getargv</groupId>
<artifactId>Getargv</artifactId>
<version>0.4</version>
</dependency>
If maven is not being used to manage dependencies, more installation instructions are available here.
You will soon need to pass a flag to Java to enable loading native code:
java --enable-native-access=ALL-UNNAMEDUse in Java code:
Getargv.asBytes(some_process_id) #=> "arg0\x00arg1"
Getargv.asArray(some_process_id) #=> ["arg0","arg1"]After checking out the repo, run mvn compile to install dependencies. Then, run mvn test to run the tests. You can also run jshell for an interactive prompt that will allow you to experiment.
Java code goes in the dirs src/main/java and src/test/java, C code goes in the dir src/main/native.
To install this package onto your local machine, run mvn install. To release a new version, update the version number in pom.xml and the Readme, and then run mvn deploy, which will push the .jar files to maven.apache.org.
Bug reports and pull requests are welcome on GitHub at https://github.com/getargv/getargv.java.
The package is available as open source under the terms of the BSD 3-clause License.