learningequality / kolibri

Kolibri Learning Platform: the offline app for universal education
https://learningequality.org/kolibri/
MIT License
755 stars 638 forks source link

define conventions for kolibri commands #3727

Open indirectlylit opened 6 years ago

indirectlylit commented 6 years ago

Observed behavior

Let's decide on conventions for manage commands.

Two recent examples:

Other inconsistencies:

Expected behavior

commands are consistent

User-facing consequences

not too much at the moment, but longer-term we want a clean command-line UI

indirectlylit commented 6 years ago

In #3594 we decided to use the command

kolibri manage content movedirectory

At the risk of bike-shedding that decision, I wanted to propose one convention update before committing to it:

Multi-word commands should be snake_case.

In this case, the command would become kolibri manage content move_directory

Mashing multiple words together without any clear separator makes them hard to read, which is especially problematic because we won't be internationalizing the commands any time soon.

(In this case, the command scans to me like "moved irectory")

lyw07 commented 6 years ago

I agree that move_directory sounds more clear. I will make changes to the command name.

benjaoming commented 6 years ago

Multi-word commands should be snake_case.

Where is the quote from @indirectlylit ? IIRC, most django management commands are without underscores or dashes, like makemigrations.

rtibbles commented 6 years ago

Yeah, it is definitely more djangoic to not underscore.

rtibbles commented 6 years ago

I believe that the quote is from himself, @benjaoming.

indirectlylit commented 6 years ago

Yes, it wasn't a quote - it was a proposal .. Note that I also updated the issue title from "kolibri manage commands" to "kolibri commands".

Agreed that we should not violate conventions if possible. However we should also give Kolibri users the best possible experience, irrespective of Django conventions they likely won't be aware of.

Perhaps we need to treat the manage subcommands as an advanced implementation detail and proxy to them. E.g.

kolibri content move-directory

could proxy to

kolibri manage content movedirectory

This would allow all user-facing commands to have a short, clean form (like start and language).

Note that GNU recommends dashes between words:

Option names are typically one to three words long, with hyphens to separate words. Users can abbreviate the option names as long as the abbreviations are unique.

benjaoming commented 6 years ago

Sorry, I can't chime in with any bias or intuition or preference here. I like kolibri content move_directory or kolibri content move-directory for readability. I like Django-ish conventions, too.

I'm +0 for both :)

benjaoming commented 6 years ago

...but I don't like the proxy or alias'ing stuff, it will have to end up in documentation, and that will make it cluttered.

benjaoming commented 6 years ago

Maybe I slightly prefer the Django-way, because I know that in 6 months, I won't be wondering if it had an underscore or not :)

benjaoming commented 6 years ago

But only very very very slightly