auspice icon indicating copy to clipboard operation
auspice copied to clipboard

Unconventional camel case for CLI args rather than GNU convention kebab-case

Open corneliusroemer opened this issue 2 years ago • 2 comments

Context

I was surprised to find that the (long) CLI args of Auspice are camel case rather than kebab case, as is conventional for CLIs

Description

Switch to using kebab-case by default, camel case should be kept for backwards compatibility only, but help should show kebab caes.

Examples

Current arguments

❯ npx auspice view --help
usage: auspice view [-h] [--verbose] [--handlers JS] [--datasetDir PATH]
                    [--narrativeDir PATH]
                    

Launch a local server to view locally available datasets & narratives. The 
handlers for (auspice) client requests can be overridden here (see 
documentation for more details). If you want to serve a customised auspice 
client then you must have run "auspice build" in the same directory as you 
run "auspice view" from.

Optional arguments:
  -h, --help           Show this help message and exit.
  --verbose            Print more verbose logging messages.
  --handlers JS        Overwrite the provided server handlers for client 
                       requests. See documentation for more details.
  --datasetDir PATH    Directory where datasets (JSONs) are sourced. This is 
                       ignored if you define custom handlers.
  --narrativeDir PATH  Directory where narratives (Markdown files) are 
                       sourced. This is ignored if you define custom handlers.

corneliusroemer avatar Jun 20 '22 17:06 corneliusroemer

Good to be thinking about this. If we change these I'd be more inclined to accept any number of paths at the end of the command which are scanned for markdown / json files. This would allow you to use recursive expansion if you store files in a hierarchy etc.

auspice view [arguments] <directory> [<directory> ...]

jameshadfield avatar Jun 20 '22 22:06 jameshadfield

Agree, since the directory is mandatory it makes a lot of sense to make it a positional argument

But the other args should in my view still be transitioned to standard kebab-case

corneliusroemer avatar Jun 21 '22 13:06 corneliusroemer