[JIRA] (JENKINS-58121) Use -- for long flags

10 views
Skip to first unread message

timjacomb1@gmail.com (JIRA)

unread,
Jun 20, 2019, 11:56:02 AM6/20/19
to jenkinsc...@googlegroups.com
Tim Jacomb created an issue
 
Jenkins / Improvement JENKINS-58121
Use -- for long flags
Issue Type: Improvement Improvement
Assignee: Natasha Stopa
Components: plugin-installation-manager-tool
Created: 2019-06-20 15:55
Priority: Minor Minor
Reporter: Tim Jacomb

It would be good to use long flags like how most other CLI tools use them

See:

https://blog.heroku.com/cli-flags-get-started-with-oclif

https://www.mankier.com/1/kubectl-create

i.e. 

-- 

instead of

-

Usage could look something like:

jenkins-plugin-manager --file plugins.txt --jenkins-war jenkins.war --plugin blah --plugin plugin2 --plugin-directory plugins/ 

A couple of examples of how short flags could look:

jenkins-plugin-manager -f new-plugins.txt 
jenkins-plugin-manager -p slack 
Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)

jnz@topdanmark.dk (JIRA)

unread,
Jun 20, 2019, 2:01:02 PM6/20/19
to jenkinsc...@googlegroups.com
Jon Brohauge commented on Improvement JENKINS-58121
 
Re: Use -- for long flags

It is considered best practice for shell-based commands to use a single dash followed by a single character, and two dashes followed by a word. One of the reasons being is that using multiple characters after a single dash can be confused for a value after the single character. I.e. `-f file` and `-ffile` can mean the same, som `-file` can be interpreted as `-f ile`.

jnz@topdanmark.dk (JIRA)

unread,
Jun 20, 2019, 2:03:02 PM6/20/19
to jenkinsc...@googlegroups.com
Jon Brohauge edited a comment on Improvement JENKINS-58121
It is considered best practice for shell-based commands to use a single dash followed by a single character, and two dashes followed by a word. One of the reasons being is that using multiple characters after a single dash can be confused for a value after the single character. I.e. `-f file` and `-ffile` can mean the same, som so `-file` can be interpreted as `-f ile`.

 

natasha.stopa@gmail.com (JIRA)

unread,
Jul 2, 2019, 5:50:02 PM7/2/19
to jenkinsc...@googlegroups.com
Natasha Stopa started work on Improvement JENKINS-58121
 
Change By: Natasha Stopa
Status: Open In Progress

natasha.stopa@gmail.com (JIRA)

unread,
Jul 4, 2019, 4:11:02 PM7/4/19
to jenkinsc...@googlegroups.com
Change By: Natasha Stopa
Status: In Progress Review

natasha.stopa@gmail.com (JIRA)

unread,
Jul 5, 2019, 2:37:02 PM7/5/19
to jenkinsc...@googlegroups.com
Change By: Natasha Stopa
Status: In Review Resolved
Resolution: Fixed
Reply all
Reply to author
Forward
0 new messages