lego icon indicating copy to clipboard operation
lego copied to clipboard

Replace --domains with --domain

Open rawtaz opened this issue 6 years ago • 6 comments

Since the --domains argument takes one domain, it should not be named in plural but singular, i.e. --domain (which can then be specified multiple times).

I realize you don't want to just remove --domains, but I suggest adding --domain as the primary argument and the one listed in the help, and keep --domains hidden, marking in deprecated wherever it's mentioned.

The other arguments are singular, luckily.

rawtaz avatar Apr 11 '18 13:04 rawtaz

It's not uncommon in CLI apps for a flag to be repeated to form an array, type domains []string for example, and it makes sense then for the name to be plural.

I'm currently grappling with this in the design of a program, and am trying to figure out whether a plural or singular form makes more sense. It probably depends if the values are together in a single value like "domain1.com,domain2.com,..." and separated by commas, or if they are listed individually.

Although I think I do like the singular form when the flag name is repeated each time.

Edit: Hi @rawtaz :wave: I have been seeing you all over the place lately :smile:

mholt avatar Apr 13 '18 19:04 mholt

I agree, it's a matter of what value(s) the flag (argument) takes.

If the value for the flag is singular, the flag should be named singular (even if the flag itself can be repeated several times).

If the value for the flag can be multiple values, then it boils down to which is more prominent - is the intention or the most common case that one supply one value or multiple values?

Hi @mholt - Nice seeing you, I love the work you do :)

rawtaz avatar Apr 16 '18 16:04 rawtaz

Hello, i would like to "upvote" that --domains will accept multiple entries.

I do usemostly SAN Certs. With powershell i have to first determine how many hostnames the site got and then jump to a predefined command containing the right amount of "--domains" parameters. Such feature would make life much easier.

thanks

zechnkaas avatar Jan 21 '19 15:01 zechnkaas

If it comes that --domains will stay, IMO the docs should be updated anyway. As a new user, I spent a lot of time 1) trying to get what delimiter to use in --domains="..." spaces, commas, semicolons - no luck 2) trying to find multiple domain example in help, then in docs on GH - no luck 3) finally opened sources and realized that there's no support 4) found this issue and put my 5 cents here.

udivankin avatar Mar 04 '21 13:03 udivankin

Hello, I came here on a path similar to @udivankin, from #806 to here, read his comment, then panicked, then realized that

  • there is support for multiple domains in single certificate
  • to obtain them you simply have to specify multiple --domains in command line as shown in the CLI help

I'm not sure if one of these issues should be closed or the main topic here is to use a single --domains instead of multiple entries, but I think everything should be more clear here to avoid confusions like mine and @udivankin's

EdoaLive avatar Jun 12 '21 10:06 EdoaLive

Any updates on this issue?

As long as --domains option can take only one value at a time, it is cumbersome to configure some bash scripting to generate domains. Since sans can be a list, it is not obvious how to make bash script to generate --domains=sans[0] --domains=sans[1] ... (the length of sans can vary)

YuryHrytsuk avatar Nov 28 '23 14:11 YuryHrytsuk