-
Notifications
You must be signed in to change notification settings - Fork 384
Closed
Labels
Milestone
Description
Description
Splitting this ticket from #170 at the request of @bitprophet
It would be nice to easily create scripts that I can place in my $PATH that internally use invoke, but are named according to script functionality. Some rational (copied from referenced ticket discussion):
I could probably train myself always to do:
inv -c /path/to/source/tree/utils/$TASK ....
But I kind of like having them:
- as a script available in my $PATH
- as tools named cognitively, just like when I'm using busybox... i just link (e.g) ls and cp rather than calling busybox ls ... or busybox cp file1 file2
- in a consistent place (depending on what I'm doing, the source tree where the task files live can vary. It's in one place on my dev machine, and different places in deployment depending on what OS, nfs details, and so on. We're still working out our "one true deployment strategy" so this changes as stuff comes up).
Also noteworthy, several of my targets are most commonly called from places in the system that are not the directory where invoke lives.
Currently I do this via the code in this gist: https://gist.github.com/sophacles/c17ce33a14d582dfa268 and creating scripts entry points in a setup.py.
To-do list
[Note: this part of the ticket is being maintained by @bitprophet]
- Parameterization of version number by itself (not name+version as we currently do)
- Parameterization of tool/package name, defaulting to the name seen in
argv[0]- Capitalized in
--versionoutput, e.g.Invoke 1.2 - Allowance for arbitrary additional lines of version info, e.g. for Fabric wanting to display its + Paramiko's, and even e.g. other data like Python version?
- Left as-is in
--helpoutput, e.g.inv[oke] --core-opts ... - Is there an automated way to determine
invvsinvokevs etc? We don't have access to setuptools' data at runtime, so we'll probably have to provide this manually. (Maybe stored in similar fashion as version - reused in both spots?)
- Capitalized in
- Ability to update global
--helpto include elements of--list, i.e. for tools distributing with built-in tasks as subcommands (which would be...most of them...Fabric is actually unusual in this regard).- I.e. probably sticking
--listtype output above the core flags, which is what most real subcommand based CLI apps tend to do (see git, pip etc)
- I.e. probably sticking
- Fix up per-task help to honor the dynamic program name (it's hardcoded right now, as above)
- Ability to override which flags are presented and/or their default values
Cleanup:
- Check all the task modules in
_supportto remove any no longer in use (& consolidate some if possible) - Check all methods in
_utils.pyfor whether they've gone out of use - Ensure docs build & the docstrings recently added look good rendered