Command string format `pkgname` instead of `pkgname.binary`
Alexander Sack
asac at canonical.com
Fri Dec 12 06:36:46 UTC 2014
Hi,
On Wed, Dec 10, 2014 at 10:28 PM, Kevin Glavin <archen.sol at gmail.com> wrote:
> Outside of frameworks, is there a way to define the command name as the
> package name instead of a `pkgname.binary`?
>
> For example, I've quickly thrown together an app for Docker Swarm (mostly to
> see if I could), but having to run `swarm.swarm [options]` is pretty silly
> compared to the documented form provided by the Docker team.
>
> Is the intended alternative to script out separate functions? e.g., instead
> of the Docker version `swarm create` write a script for the command
> `swarm.swarm create` that is obfuscated as `swarm.create`? Then add
> `swarm.join`, `swarm.manage`, etc.?
we currently don't have a better way to do this. the reason why the
command is namespaced is so that apps can be distributed easily
without anyone having to bother about conflict hell.
If you have commands in your source that match those ops (create,
join, etc.) you can use the binary: field in the package.yaml to map
them as you suggest above:
binaries:
- create: path/to/swarm/create-shorthand
- join: path/to/swarm/bin/join-shorthand
Guess for now you can workaround by doing such shorthand wrappers i
your package.
Going forward we could try to grow feature of the binaries field to do
something along the lines:
binaries:
- create: path/to/swarm create
- join: path/to/swarm join
or something more elegant.
Anyone has thoughts?
- Alexander
>
> --
> Kevin Glavin
>
> --
> snappy-app-devel mailing list
> snappy-app-devel at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/snappy-app-devel
>
More information about the snappy-app-devel
mailing list