Ambrevar / demlo

[MOVED TO GITLAB] A dynamic and extensible music library organizer
https://gitlab.com/ambrevar/demlo
MIT License
11 stars 1 forks source link

Let -s ignore number prefix of script to include #3

Closed fictionic closed 6 years ago

fictionic commented 6 years ago

The indeces of the scripts are an implementation detail that the user should not need to worry about. The user only cares about the functionality of the included script, which is indicated in the main part of the name. E.g. -s cover vs -s 70-cover.

Another, more drastic idea would be to make -s work exactly like -r—that is, make it include all scripts whose name match the provided regex. This is desirable for the same reason as it is for -r. Suppose you have two scripts that deal with file tags (as I do): 10-tag-fields and 11-tag-contents. If you want to run only those scripts, you'd need to do -r '' -s 10-tag-fields -s 11-tag-contents. With the regex strategy, this becomes -r '' -s tag. This also occurs when the scripts you want to include are not run by default.

What do you think?

Ambrevar commented 6 years ago

In retrospect, the commandline usability of demlo suffers from debatable design decisions. Your suggestion only tackles the tip of iceberg...

  1. First of, to make sure there is no misunderstanding: indices are used to sort scripts in the script chain. For instance, 10-tag is run before 60-path, which is almost always what we want.

I think there originally were a few reason as for why -s does not accept regexp; however, with latest versions none of them seems to be valid anymore.

  1. Pro-tip: If you use the fish shell or Eshell, demlo can auto-complete the script names.

Completion does not work on -r though, I think it's an oversight. I should fix that too.

Ambrevar commented 6 years ago

Other points unrelated to your request, but I'm curious if you'd have any comment on this.

  1. I think each script should come with an individual help which would provide a description, a list of the global variables in use if any, and some examples. I believe that would make Demlo dramatically more user friendly.

  2. Sensible defaults: right now, the included demlorc is not parsed in the system folder. I think Demlo should parse it so that a config-less Demlo does something meaningful by default instead of doing nothing. It would still be possible revert to the current behaviour by either uninstalling the system demlorc or by creating and empty user demlorc.

Ambrevar commented 6 years ago
  1. Write a GUI. See #4.
fictionic commented 6 years ago
  1. Yes I do know the purpose of the prefixes. That's all good.
  2. I know, and I use zsh... is zsh completion something you plan on doing? Not the biggest priority obviously, but it would be nice.
  3. Yes, in fact that is something I plan to do for my own demlo script system (which sort of creates its own use framework anyway). See here (it's still a work in progress, but it's usable).
  4. Ah, that is also a good idea! Though how would you deal with the fact that the user might have modified the scripts in the user config folder? I suppose if that folder exists then the system one should be ignored?
Ambrevar commented 6 years ago

(2) I've dumped zsh a long time ago... Too much insanity there for me, sorry :p I'll welcome any contribution however, obviously.

(4) You meant demlorc, right? Then that's correct.

fictionic commented 6 years ago

(2) Yeah it's hella complicated for sure. I'll look into it at some point.

(3) Yep

I'd also love any feedback you have on my demloconf repo that I linked above; I've worked on it a whole lot!

Ambrevar commented 6 years ago

Fixed in 285f069975bbb238b7403a316a7580fef4446296.

Ambrevar commented 6 years ago

@fictionic Let me know if that works for you.