xmlcmd
xmlcmd is a proof of concept experiment in augmenting standard POSIX commands with superpowers, such as outputting xml.
Sadly it is more sleight of hand than any real magic.
To begin with, a directory which is first on the PATH must be created (e.g. ~/bin). This should not be on the path which whereis uses, so if things go wrong you can always do $(whereis cmd) to execute affected commands.
The idea is to put symlinks to xmlcmd (which is created in the normal python setup.py install installation) into this directory for a number of commands. When these commands are run with an –xml option, the _{cmd} module will be imported from the xmlcmd package and the main() function run with two arguments: the original list of command line arguments (typically corresponding to sys.argv) minus the --xml, and the full path to the ‘original’ file which would have been run if the --xml option had not been specified.
This is similar to the way busybox works to implement a whole range of UNIX commands from a single binary, by using argv[0] to determine the required action. This allows the relevant logic to be factored out into a single place.
ben$ sudo pip install xmlcmd ... ben$ ln -s $(which xmlcmd) ~/bin/ls ben$ ls --xml <an XMLish representation of a file listing...>
Plans:
Add a few more commands (currently only supports ls and ps)
Put a bunch of actually helpful XML output things into the xmlcmd package to simplify creation of additional command helpers
A more useful xpath command than the perl program of that name on my OS X and Ubuntu installs
Ben Bass 2011
Metadata
Release files for xmlcmd 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| xmlcmd-0.1.2.tar.gz | 3.1 kB | Without provenance | Details for xmlcmd-0.1.2.tar.gz |
Release files / xmlcmd-0.1.2.tar.gz
| Download URL | xmlcmd-0.1.2.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f235d49283af6b25f45251da1b2b5b7e1706c7c29e8a1668cb95c2311b7b1441
|
|
BLAKE2b-256 checksum How to use checksums |
3c5f4ea6915924023b7e442cbac93e8023bd3be328bdb563c2b5a9c2ced7990a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for xmlcmd 0.1.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.