[feature] Make types more discoverable #73
Labels
No Label
bugfix
cleanup
discussion
documentation
doing
done
feature
improvement
packaging
Stale
testing
TODO
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: ungleich-public/cdist#73
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Consider adding a
cdist find_type ${TERM}
command that basically doesgrep -r "${TERM}" "${CDIST_DIR}/cdist/conf/type" "${USER_CDIST_DIR}/type"
I guess even those well-versed in current cdist types may get lost at times and could use something like this to quickly find what they need.
closed
mentioned in merge request !825
One question.
What are the advantages of
cdist info
over maintained man pagecdist-types
which contains general info about types?Yes, there are no local types (custom user types), but info about them could be maintained, well, locally too :)
@ander I realized that after creating MR for this, that it should be written in python.
But then, I wanted to see a reaction :)
And since it shows type info, then it is really a
cdist config
info so the command should becdist config info
, or?that's annoying 😿
also, why shell script? wouldn't it be easier to be implemented in python since all information is there anyway? same thing with dump. no need to re-implement stuff in shell etc.
also. lots of flags. you'll run out of alphabet soon :cartwheel:
I think we are overengineering here. maybe we should re-think which is needed for user vs diehard cdist masochist. average cdist user (and myself) don't really care which types have gencode-remote, which ones have manifest etc. I only want to find answers quickly.
cdist info <glob>
and be done with it.for example
cdist info __
will show all types with all information about then. and from there you can go more into detail eg__apt_
etc. give user grep (over paths) and they will do the rest 👼mentioned in merge request !824
Here is my first attempt for supporting libexec and migrating cdist-dump to libexec:
7dddcb794b
.I will add core 'libexec' support for 'libexec' directory under official 'conf' directory.
Here, internal binaries/scripts should be placed.
I will add core support for detecting such binaries/scripts.
These should be named with 'cdist-' prefix.
'cdist-dump' will be migrated into this directory.
What do you think?
cdist info
IMHO it should be either
cdist find
or if it only works on types it should be namespaced.e.g.
@evilham @nico @ander Can you list what
cdist list
should do, what you expect from it?Should it be
cdist find
?...
What is the information it should provide?
we have
cdist inventory list
. ls vs list? make ls as alias? 🤷for the sake of consistency, we should spell out commands and not use abbrs.
YES PLEASE
one utility tule rule them all
@nico Should we implement such commands as cdist core shell scripts for which cdist python implementation is a wrapper?
We can write cdist core part that detects core/support commands.
Then new command is just written as an executable inside libexec or similar sub-directory, and cdist core detects it.
Then we can also migrate cdist-dump to
cdist dump
, as such command.@ander I like it. It reminds me of https://www.cdi.st/manual/latest/man1/cdist-dump.html, but this time for
conf
directories.@ander You are basically describing
ls
and I really like it. Something on the line ofcdist ls --types
cdist ls --all
(default?)cdist ls --manifests
lets try to be consistent.
instead of
ls-types
, maybe something more generic, which lists all manifests, types and explorers from all the dirs where cdist will look for them: install dir, conf dir and current user home dir.maybe
list
, which just prints all available types, explorers and manifests, andlist fuzzystring
for getting list params for matched types?for example, most of the time, when i open manual, i want to see parameters list. and the output of
cdist list __type
should be useable with grepawksed&family so we can create editor integration. magic. for example, output ofcdist list fuzzystring
:I have to say I see some convenience here, especially if -C is given multiple times.
@evilham can you do a prototype on
cdist ls-types
which accepts standard glob afterwards? I think if the code is cleanly separated (which it should be easily doable), I'm open for adding things that make the user experience nicer.I mean, in the end cdist is there to make life easier.
to get list of available types? just open https://www.cdi.st/manual/latest/cdist-types.html ?
i have this bookmarked. tho, sometimes I need to look at the code for ideas, but then i know where to look 🤷
@nico @steven What do you think?