Skip to content

kolibri cli returns exit code 1 if not parameter is passed#5937

Merged
rtibbles merged 1 commit into
learningequality:developfrom
jredrejo:click_exit_code
Sep 13, 2019
Merged

kolibri cli returns exit code 1 if not parameter is passed#5937
rtibbles merged 1 commit into
learningequality:developfrom
jredrejo:click_exit_code

Conversation

@jredrejo
Copy link
Copy Markdown
Contributor

Summary

When kolibri cli is run without any options it retuns the help system and exit code 1

Reviewer guidance

  1. Run kolibriwithout any option

  2. It should return kolibri help

  3. Executing echo $? should return 1

  4. Run kolibri with any valid option (ex. kolibri stop)

  5. Executing echo $? should return 0

References

Closes: #5930

Contributor Checklist

PR process:

  • PR has the correct target branch and milestone
  • PR has 'needs review' or 'work-in-progress' label
  • If PR is ready for review, a reviewer has been added. (Don't use 'Assignees')
  • If this is an important user-facing change, PR or related issue has a 'changelog' label
  • If this includes an internal dependency change, a link to the diff is provided

Testing:

  • Contributor has fully tested the PR manually
  • If there are any front-end changes, before/after screenshots are included
  • Critical user journeys are covered by Gherkin stories
  • Critical and brittle code paths are covered by unit tests

Reviewer Checklist

  • Automated test coverage is satisfactory
  • PR is fully functional
  • PR has been tested for accessibility regressions
  • External dependency files were updated if necessary (yarn and pip)
  • Documentation is updated
  • Contributor is in AUTHORS.md

@jredrejo jredrejo added the TODO: needs review Waiting for review label Sep 12, 2019
@jredrejo jredrejo added this to the 0.13.0 milestone Sep 12, 2019
@codecov
Copy link
Copy Markdown

codecov Bot commented Sep 12, 2019

Codecov Report

Merging #5937 into develop will increase coverage by 0.04%.
The diff coverage is 40%.

Impacted Files Coverage Δ
kolibri/utils/cli.py 74.63% <40%> (-0.75%) ⬇️
kolibri/utils/server.py 48.88% <0%> (+0.74%) ⬆️
kolibri/core/decorators.py 61.61% <0%> (+1.01%) ⬆️
kolibri/utils/system.py 35.59% <0%> (+1.69%) ⬆️
kolibri/core/discovery/utils/filesystem/posix.py 62.74% <0%> (+4.9%) ⬆️
kolibri/utils/compat.py 100% <0%> (+5.71%) ⬆️

Copy link
Copy Markdown
Contributor

@benjaoming benjaoming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jredrejo - the new behavior is nice and explicit! 👍

@rtibbles
Copy link
Copy Markdown
Member

rtibbles commented Sep 12, 2019

Is this usual behaviour for help text? I can't check on my computer right now, but does just grep or git return an exit code of 0 or 1?

I looked at the original issue here and couldn't quite follow why this change was needed.

@jredrejo
Copy link
Copy Markdown
Contributor Author

@rtibbles you are asking the same question I did in the original issue. I checked it and @benjaoming was right. All the apps I could test return a non-zero error code when they show help after being executed without any parameter. For your examples, git returns 1 while grep returns 2.

@rtibbles
Copy link
Copy Markdown
Member

Righto, sounds like we should file an upstream issue with Click too!

@benjaoming
Copy link
Copy Markdown
Contributor

Great idea @rtibbles - hereby reported, as I couldn't find any existing issue.

@jredrejo jredrejo deleted the click_exit_code branch September 13, 2019 16:13
@jonboiser jonboiser removed the TODO: needs review Waiting for review label Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Running command "kolibri" (no args) gives return status 0

4 participants